|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cts.util.AngleFormat
public final class AngleFormat
Formatter to print angles as a degrees/minutes/seconds (DMS) and to parse DMS strings
The format method uses pattern such as #D� MM' SS\" H(N|S) to define the string representation of an angle.
| Field Summary | |
|---|---|
static AngleFormat |
LATITUDE_FORMATTER
|
static AngleFormat |
LONGITUDE_FORMATTER
|
| Constructor Summary | |
|---|---|
AngleFormat()
|
|
AngleFormat(String pattern)
Create a new angle formatter able to write an angle as a DMS string following a specific pattern. |
|
| Method Summary | |
|---|---|
static double |
dd2dms(double ddAngle)
|
static double |
deg2gra(double angle)
|
static double |
deg2min(double angle)
|
static double |
deg2rad(double angle)
|
static double |
deg2sec(double angle)
|
static double |
dms2dd(double dmsAngle)
|
String |
format(double angle)
Format an angle following the special pattern defined by this object. |
static double |
gra2deg(double angle)
|
static double |
gra2rad(double angle)
|
static double |
parseAndConvert2Radians(String angle)
This method parse a string which represent an angle in radians, in grades or in degrees. |
static double |
parseAngle(String angle)
Parse a string representing an angle written in DMSH (degrees / minutes / seconds / hemisphere). |
static double |
rad2deg(double angle)
|
static double |
rad2gra(double angle)
|
static double |
rad2min(double angle)
|
static double |
rad2sec(double angle)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final AngleFormat LONGITUDE_FORMATTER
public static final AngleFormat LATITUDE_FORMATTER
| Constructor Detail |
|---|
public AngleFormat()
public AngleFormat(String pattern)
throws IllegalArgumentException
pattern - the Pattern to format angles
Exemples :
IllegalArgumentException| Method Detail |
|---|
public static double rad2deg(double angle)
public static double rad2gra(double angle)
public static double rad2min(double angle)
public static double rad2sec(double angle)
public static double deg2rad(double angle)
public static double deg2gra(double angle)
public static double deg2min(double angle)
public static double deg2sec(double angle)
public static double gra2rad(double angle)
public static double gra2deg(double angle)
public static double dms2dd(double dmsAngle)
public static double dd2dms(double ddAngle)
public String format(double angle)
angle - angle to format (the angle must be in degrees).
public static double parseAngle(String angle)
throws IllegalArgumentException
angle - the string to parse
IllegalArgumentException
public static double parseAndConvert2Radians(String angle)
throws IllegalArgumentException
This method parse a string which represent an angle in radians, in grades or in degrees.
The parser try to recognize a symbol to determine the units used in the string and convert the angle into radians.
IllegalArgumentException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||