|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.worldwind.geom.Angle
public class Angle
Represents a geometric angle. Instances of Angle
are immutable. An angle can be obtained through the
factory methods fromDegrees(double)
and fromRadians(double)
.
Field Summary | |
---|---|
static String |
ANGLE_FORMAT_DD
|
static String |
ANGLE_FORMAT_DMS
|
double |
degrees
|
static Angle |
MINUTE
Represents an angle of 1 minute |
static Angle |
NEG180
Represents an angle of negative 180 degrees |
static Angle |
NEG360
Represents an angle of negative 360 degrees |
static Angle |
NEG90
Represents a right angle of negative 90 degrees |
static Angle |
POS180
Represents an angle of positive 180 degrees |
static Angle |
POS360
Represents an angle of positive 360 degrees |
static Angle |
POS90
Represents a right angle of positive 90 degrees |
double |
radians
|
static Angle |
SECOND
Represents an angle of 1 second |
static Angle |
ZERO
Represents an angle of zero degrees |
Constructor Summary | |
---|---|
Angle(Angle angle)
|
Method Summary | |
---|---|
static Angle |
acos(double cosine)
|
Angle |
add(Angle angle)
Obtains the sum of these two angles. |
Angle |
addDegrees(double degrees)
|
Angle |
addRadians(double radians)
|
Angle |
angularDistanceTo(Angle angle)
Computes the shortest distance between this and angle, as an angle. |
static Angle |
asin(double sine)
|
static Angle |
atan(double tan)
|
static Angle |
average(Angle a,
Angle b)
Obtains the average of three angles. |
static Angle |
average(Angle a,
Angle b,
Angle c)
Obtains the average of three angles. |
int |
compareTo(Angle angle)
Compares this Angle with another. |
double |
cos()
Obtains the cosine of this angle. |
double |
cosHalfAngle()
|
static boolean |
crossesLongitudeBoundary(Angle angleA,
Angle angleB)
|
double |
divide(Angle angle)
Divides this angle by another angle. |
Angle |
divide(double divisor)
Divides this angle by divisor . |
boolean |
equals(Object o)
|
static Angle |
fromDegrees(double degrees)
Obtains an angle from a specified number of degrees. |
static Angle |
fromDegreesLatitude(double degrees)
|
static Angle |
fromDegreesLongitude(double degrees)
|
static Angle |
fromDMS(int degrees,
int minutes,
int seconds)
Obtain an angle from a given number of degrees, minutes and seconds. |
static Angle |
fromDMS(String dmsString)
Obtain an angle from a degrees, minute and seconds character string. |
static Angle |
fromRadians(double radians)
Obtains an angle from a specified number of radians. |
static Angle |
fromRadiansLatitude(double radians)
|
static Angle |
fromRadiansLongitude(double radians)
|
static Angle |
fromXY(double x,
double y)
Obtains an angle from rectangular coordinates. |
double |
getDegrees()
Retrieves the size of this angle in degrees. |
double |
getRadians()
Retrieves the size of this angle in radians. |
long |
getSizeInBytes()
Obtains the amount of memory this Angle consumes. |
int |
hashCode()
|
static boolean |
isValidLatitude(double value)
|
static boolean |
isValidLongitude(double value)
|
static Angle |
max(Angle a,
Angle b)
|
static Angle |
midAngle(Angle a1,
Angle a2)
Obtains the average of two angles. |
static Angle |
min(Angle a,
Angle b)
|
static Angle |
mix(double amount,
Angle value1,
Angle value2)
Linearly interpolates between two angles. |
Angle |
multiply(double multiplier)
Multiplies this angle by multiplier . |
Angle |
normalizedLatitude()
|
static Angle |
normalizedLatitude(Angle unnormalizedAngle)
|
Angle |
normalizedLongitude()
|
static Angle |
normalizedLongitude(Angle unnormalizedAngle)
|
double |
sin()
Obtains the sine of this angle. |
double |
sinHalfAngle()
|
Angle |
subtract(Angle angle)
Obtains the difference of these two angles. |
Angle |
subtractDegrees(double degrees)
|
Angle |
subtractRadians(double radians)
|
double |
tanHalfAngle()
Obtains the tangent of half of this angle. |
String |
toDecimalDegreesString(int digits)
Forms a decimal degrees String representation of this Angle . |
double[] |
toDMS()
|
String |
toDMSString()
Obtains a String representation of this Angle formated as degrees, minutes and seconds. |
String |
toFormattedDMSString()
|
String |
toString()
Obtains a String representation of this angle. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ANGLE_FORMAT_DD
public static final String ANGLE_FORMAT_DMS
public final double degrees
public static final Angle MINUTE
public static final Angle NEG180
public static final Angle NEG360
public static final Angle NEG90
public static final Angle POS180
public static final Angle POS360
public static final Angle POS90
public final double radians
public static final Angle SECOND
public static final Angle ZERO
Constructor Detail |
---|
public Angle(Angle angle)
Method Detail |
---|
public static Angle acos(double cosine)
public final Angle add(Angle angle)
a.add(b)
and b.add(a)
are equivalent. Neither this angle nor angle is changed, instead
the result is returned as a new angle.
angle
- the angle to add to this one.
IllegalArgumentException
- if angle is null.public final Angle addDegrees(double degrees)
public final Angle addRadians(double radians)
public Angle angularDistanceTo(Angle angle)
angle
- the angle to measure angular distance to.
value
.public static Angle asin(double sine)
public static Angle atan(double tan)
public static Angle average(Angle a, Angle b)
a
- the first angle.b
- the second angle.
a1
, a2
and a3
IllegalArgumentException
- if a
or b
is nullpublic static Angle average(Angle a, Angle b, Angle c)
a
- the first angle.b
- the second angle.c
- the third angle.
a1
, a2
and a3
.
IllegalArgumentException
- if a
, b
or c
is null.public final int compareTo(Angle angle)
Angle
with another. Returns a negative integer if this is the smaller angle, a positive
integer if this is the larger, and zero if both angles are equal.
compareTo
in interface Comparable<Angle>
angle
- the angle to compare against.
IllegalArgumentException
- if angle is null.public final double cos()
public final double cosHalfAngle()
public static boolean crossesLongitudeBoundary(Angle angleA, Angle angleB)
public final double divide(Angle angle)
angle
- the angle by which to divide.
IllegalArgumentException
- if angle is null.public final Angle divide(double divisor)
divisor
. This angle remains unchanged. The result is returned as a new angle.
Behaviour is undefined if divisor
equals zero.
divisor
- the number to be divided by.
divisor
.public boolean equals(Object o)
equals
in class Object
public static Angle fromDegrees(double degrees)
degrees
- the size in degrees of the angle to be obtained
degrees
public static Angle fromDegreesLatitude(double degrees)
public static Angle fromDegreesLongitude(double degrees)
public static Angle fromDMS(int degrees, int minutes, int seconds)
degrees
- integer number of degrees, positive.minutes
- integer number of minutes, positive only between 0 and 60.seconds
- integer number of seconds, positive only between 0 and 60.
degrees
, minutes
and
seconds
.
IllegalArgumentException
- if minutes or seconds are outside the 0-60 range.public static Angle fromDMS(String dmsString)
eg:
123 34 42 -123° 34' 42" +45° 12' 30" 45 12 30 S 45 12 30 N
dmsString
- the degrees, minute and second character string.
IllegalArgumentException
- if dmsString is null or not properly formated.public static Angle fromRadians(double radians)
radians
- the size in radians of the angle to be obtained.
radians
.public static Angle fromRadiansLatitude(double radians)
public static Angle fromRadiansLongitude(double radians)
public static Angle fromXY(double x, double y)
x
- the abscissa coordinate.y
- the ordinate coordinate.
x
and y
.public final double getDegrees()
public final double getRadians()
java.lang.Math
functions, which
generally take radians as trigonometric arguments. This method may be faster that first obtaining the degrees and
then converting to radians.
public long getSizeInBytes()
Angle
consumes.
public int hashCode()
hashCode
in class Object
public static boolean isValidLatitude(double value)
public static boolean isValidLongitude(double value)
public static Angle max(Angle a, Angle b)
public static Angle midAngle(Angle a1, Angle a2)
midAngle(m, n)
and
midAngle(n, m)
are equivalent.
a1
- the first angle.a2
- the second angle.
a1
and a2
throws IllegalArgumentException if either angle is
null.public static Angle min(Angle a, Angle b)
public static Angle mix(double amount, Angle value1, Angle value2)
amount
- the interpolant.value1
- the first angle.value2
- the second angle.
value1
and value2
.public final Angle multiply(double multiplier)
multiplier
. This angle remains unchanged. The result is returned as a new
angle.
multiplier
- a scalar by which this angle is multiplied.
multiplier
.public Angle normalizedLatitude()
public static Angle normalizedLatitude(Angle unnormalizedAngle)
public Angle normalizedLongitude()
public static Angle normalizedLongitude(Angle unnormalizedAngle)
public final double sin()
public final double sinHalfAngle()
public final Angle subtract(Angle angle)
angle
- the angle to subtract from this angle.
IllegalArgumentException
- if angle is null.public final Angle subtractDegrees(double degrees)
public final Angle subtractRadians(double radians)
public final double tanHalfAngle()
public final String toDecimalDegreesString(int digits)
String
representation of this Angle
.
digits
- the number of digits past the decimal point to include in the string.
public final double[] toDMS()
public final String toDMSString()
String
representation of this Angle
formated as degrees, minutes and seconds.
public final String toFormattedDMSString()
public final String toString()
String
representation of this angle.
toString
in class Object
String
.
|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |