Overview | Package | Class | Use | Tree | Index | Help
| NASA World Wind
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gov.nasa.worldwind.geom
Class Angle

    java.lang.Object
      gov.nasa.worldwind.geom.Angle

All Implemented Interfaces:
  Comparable<Angle>

    public class Angle

extends Object
implements Comparable<Angle>

Represents a geometric angle. Instances of `Angle` are immutable. An `Angle` can be obtained through the factory methods `fromDegrees` and `fromRadians`.

Field Summary
`double` | `degrees`
`static Angle` | `NEG180` Represents an angle of negative 180 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` | `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 `Angle`s.
`Angle` | `addDegrees(double degrees)`
`Angle` | `addRadians(double radians)`
`static Angle` | `asin(double sine)`
`static Angle` | `atan(double tan)`
`static Angle` | `average(Angle a, Angle b)` Obtains the average of three `Angle`s.
`static Angle` | `average(Angle a, Angle b, Angle c)` Obtains the average of three `Angle`s.
`int` | `compareTo(Angle angle)` Compares this `Angle` with `angle` for order.
`double` | `cos()` Obtains the cosine of this `Angle`
`double` | `cosHalfAngle()`
`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` | `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 Angle` | `midAngle(Angle a1, Angle a2)` Obtains the average of two `Angle`s.
`Angle` | `multiply(double multiplier)` Multiplies this `Angle` by `multiplier`.
`double` | `sin()` Obtains the sine of this `Angle`.
`double` | `sinHalfAngle()`
`Angle` | `subtract(Angle angle)` Obtains the difference of these two `Angle`s.
`Angle` | `subtractDegrees(double degrees)`
`Angle` | `subtractRadians(double radians)`
`double` | `tanHalfAngle()` Obtains the tangent of half of this `Angle`.
`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

### degrees

    public final double degrees

### NEG180

    public static final Angle NEG180

  Represents an angle of negative 180 degrees

### NEG90

    public static final Angle NEG90

  Represents a right angle of negative 90 degrees

### POS180

    public static final Angle POS180

  Represents an angle of positive 180 degrees

### POS360

    public static final Angle POS360

  Represents an angle of positive 360 degrees

### POS90

    public static final Angle POS90

  Represents a right angle of positive 90 degrees

### radians

    public final double radians

### ZERO

    public static final Angle ZERO

  Represents an angle of zero degrees

Constructor Detail

### Angle

    public Angle(Angle angle)

Method Detail

### acos

    public static Angle acos(double cosine)

### add

    public final Angle add(Angle angle)

  Obtains the sum of these two `Angle`s. Does not accept a null argument. This method is commutative, so `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`.

  Parameters:
    `angle` - the `Angle` to add to this one.
  Returns:
    an `Angle` whose size is the total of this `Angle`s and `angle`s size
  Throws:
    `IllegalArgumentException` - if `angle` is null

### addDegrees

    public final Angle addDegrees(double degrees)

### addRadians

    public final Angle addRadians(double radians)

### asin

    public static Angle asin(double sine)

### atan

    public static Angle atan(double tan)

### average

    public static Angle average(Angle a,
                                Angle b)

  Obtains the average of three `Angle`s. The order of parameters does not matter.

  Parameters:
    `a` - the first `Angle`
    `b` - the second `Angle`
  Returns:
    the average of `a1`, `a2` and `a3`
  Throws:
    `IllegalArgumentException` - if `a` or `b` is null

### average

    public static Angle average(Angle a,
                                Angle b,
                                Angle c)

  Obtains the average of three `Angle`s. The order of parameters does not matter.

  Parameters:
    `a` - the first `Angle`
    `b` - the second `Angle`
    `c` - the third `Angle`
  Returns:
    the average of `a1`, `a2` and `a3`
  Throws:
    `IllegalArgumentException` - if `a`, `b` or `c` is null

### compareTo

    public final int compareTo(Angle angle)

  Compares this `Angle` with `angle` for order. Returns a negative integer if this is the smaller `Angle`, a positive integer if this is the larger, and zero if both `Angle`s are equal.

  Specified by:
    `compareTo` in interface `Comparable<Angle>`
  Parameters:
    `angle` - the `Angle` to compare against
  Returns:
    -1 if this `Angle` is smaller, 0 if both are equal and +1 if this `Angle` is larger.
  Throws:
    `IllegalArgumentException` - if `angle` is null

### cos

    public final double cos()

  Obtains the cosine of this `Angle`

  Returns:
    the trigonometric cosine of this `Angle`

### cosHalfAngle

    public final double cosHalfAngle()

### divide

    public final double divide(Angle angle)

  Divides this `Angle` by another angle. This `Angle` remains unchanged, instead the resulting value in degrees is returned.

  Parameters:
    `angle` - the `Angle` by which to divide
  Returns:
    this `Angle`'s degrees divided by `angle`'s degrees
  Throws:
    `IllegalArgumentException` - if `angle` is null

### divide

    public final Angle divide(double divisor)

  Divides this `Angle` by `divisor`. This `Angle` remains unchanged. The result is returned as a new `Angle`. Behaviour is undefined if `divisor` equals zero.

  Parameters:
    `divisor` - the number to be divided by
  Returns:
    a new `Angle` equivalent to this `Angle` divided by `divisor`

### equals

    public boolean equals(Object o)

  Overrides:
    `equals` in class `Object`

### fromDegrees

    public static Angle fromDegrees(double degrees)

  Obtains an `Angle` from a specified number of degrees.

  Parameters:
    `degrees` - the size in degrees of the `Angle` to be obtained
  Returns:
    a new `Angle`, whose size in degrees is given by `degrees`

### fromDegreesLatitude

    public static Angle fromDegreesLatitude(double degrees)

### fromDegreesLongitude

    public static Angle fromDegreesLongitude(double degrees)

### fromRadians

    public static Angle fromRadians(double radians)

  Obtains an `Angle` from a specified number of radians.

  Parameters:
    `radians` - the size in radians of the `Angle` to be obtained
  Returns:
    a new `Angle`, whose size in radians is given by `radians`

### fromRadiansLatitude

    public static Angle fromRadiansLatitude(double radians)

### fromRadiansLongitude

    public static Angle fromRadiansLongitude(double radians)

### fromXY

    public static Angle fromXY(double x,
                               double y)

  Obtains an `Angle` from rectangular coordinates.

  Parameters:
    `x` - the abscissa coordinate
    `y` - the ordinate coordinate
  Returns:
    a new `Angle`, whose size is determined from `x` and `y`

### getDegrees

    public final double getDegrees()

  Retrieves the size of this `Angle` in degrees. This method may be faster than first obtaining the radians and then converting to degrees.

  Returns:
    the size of this `Angle` in degrees

### getRadians

    public final double getRadians()

  Retrieves the size of this `Angle` in radians. This may be useful for `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.

  Returns:
    the size of this `Angle` in radians.

### getSizeInBytes

    public long getSizeInBytes()

  Obtains the amount of memory this `Angle` consumes.

  Returns:
    the memory footprint of this `Angle` in bytes.

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### midAngle

    public static Angle midAngle(Angle a1,
                                 Angle a2)

  Obtains the average of two `Angle`s. This method is commutative, so `midAngle(m, n)` and `midAngle(n, m)` are equivalent.

  Parameters:
    `a1` - the first `Angle`
    `a2` - the second `Angle`
  Returns:
    the average of `a1` and `a2` throws IllegalArgumentException if either angle is null

### multiply

    public final Angle multiply(double multiplier)

  Multiplies this `Angle` by `multiplier`. This `Angle` remains unchanged. The result is returned as a new `Angle`.

  Parameters:
    `multiplier` - a scalar by which this `Angle` is multiplied
  Returns:
    a new `Angle` whose size equals this `Angle`'s size multiplied by `multiplier`

### sin

    public final double sin()

  Obtains the sine of this `Angle`.

  Returns:
    the trigonometric sine of this `Angle`

### sinHalfAngle

    public final double sinHalfAngle()

### subtract

    public final Angle subtract(Angle angle)

  Obtains the difference of these two `Angle`s. Does not accept a null argument. This method is not commutative. Neither this `Angle` nor `angle` is changed, instead the result is returned as a new `Angle`.

  Parameters:
    `angle` - the `Angle` to subtract from this `Angle`
  Returns:
    a new `Angle` correpsonding to this `Angle`'s size minus `angle`'s size
  Throws:
    `IllegalArgumentException` - if `angle` is null

### subtractDegrees

    public final Angle subtractDegrees(double degrees)

### subtractRadians

    public final Angle subtractRadians(double radians)

### tanHalfAngle

    public final double tanHalfAngle()

  Obtains the tangent of half of this `Angle`.

  Returns:
    the trigonometric tangent of half of this `Angle`

### toString

    public final String toString()

  Obtains a `String` representation of this `Angle`.

  Overrides:
    `toString` in class `Object`
  Returns:
    the value of this `Angle` in degrees and as a `String`

Overview | Package | Class | Use | Tree | Index | Help
| NASA World Wind
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD