Class pmr.euclid.Angle
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.euclid.Angle
java.lang.Object

+pmr.euclid.Status

+pmr.euclid.Angle
 public class Angle
 extends Status
Angle  angle object
Angle represents an angle. The reason for the class is to help remember
about radian/degree problems, to keep the angle in the right range
(0, 2*PI) or (PI, PI) as required, and to format output.
To construct an angle the user must consciously use RADIANS
The angle returned is always in RADIANS (except if getDegrees() is used).
If SIGNED is used, the angle is in the range 180 to 180 (pi to pi)
If UNSIGNED is used, the angle is in the range 0 to 360 (0 to 2*pi)
Default is SIGNED
Default value of Angle is 0.0; Constructions of invalid angles should
throw exceptions rather than try to make invalid angles.
 Author:
 (C) P. MurrayRust, 1996

DEGREES


DEGREES_IN_RADIAN


RADIANS
 set Radians or degrees for output

SIGNED
 PI to PI

UNLIMITED
 Any value

UNSIGNED
 0 to 2*PI

Angle()
 create deafult Angle (0.0)

Angle(Angle)
 copy constructor

Angle(double)
 create an angle IN RADIANS

Angle(double, AngleType)
 construct using degrees or radians

Angle(double, double)
 from X and Y components (uses atan2)

clone(Angle)


cos()
 trigonometric functions

equals(Angle)
 are two angles equal?

equals(double)
 are two angles equal? RADIANS

getAngle()
 get angle in radians

getDegrees()
 get angle in degrees

getRadian()
 get angle in radians

greaterThan(Angle)
 is one angle greater than another (after normalisation)

greaterThan(double)
 is one angle greater than another (after normalisation)

greaterThanOrEquals(Angle)
 is one angle greater than or equal to another (after normalisation)

greaterThanOrEquals(double)
 is one angle greater than or equal to another (after normalisation)

lessThan(Angle)
 is one angle less than another (after normalisation)

lessThan(double)
 is one angle less than another (after normalisation)

lessThanOrEquals(Angle)
 is one angle less than or equal to another (after normalisation)

lessThanOrEquals(double)
 is one angle less than or equal to another (after normalisation)

main(String[])


multiplyBy(double)
 multiply an angle by a scalar

normalise(double)
 normalise angle (in radians) to range 0 > 2*PI

plus(Angle)
 add two angles

putDegrees(double)
 input angle in degrees

setRange(AngleRange)
 set type of range

shallowCopy(Angle)
 shallowCopy

sin()


subtract(Angle)
 subtract two angles

tan()


toString()

UNLIMITED
public final static AngleRange UNLIMITED
 Any value
UNSIGNED
public final static AngleRange UNSIGNED
 0 to 2*PI
SIGNED
public final static AngleRange SIGNED
 PI to PI
RADIANS
public final static AngleType RADIANS
 set Radians or degrees for output
DEGREES
public final static AngleType DEGREES
DEGREES_IN_RADIAN
public final static double DEGREES_IN_RADIAN
Angle
public Angle()
 create deafult Angle (0.0)
Angle
public Angle(double a)
 create an angle IN RADIANS
Angle
public Angle(double a,
AngleType units)
 construct using degrees or radians
Angle
public Angle(double x,
double y)
 from X and Y components (uses atan2)
Angle
public Angle(Angle a)
 copy constructor
shallowCopy
public void shallowCopy(Angle a)
 shallowCopy
clone
public Angle clone(Angle a)
plus
public Angle plus(Angle a2)
 add two angles
subtract
public Angle subtract(Angle a2)
 subtract two angles
multiplyBy
public Angle multiplyBy(double f)
 multiply an angle by a scalar
cos
public double cos()
 trigonometric functions
sin
public double sin()
tan
public double tan()
normalise
public static double normalise(double angle)
 normalise angle (in radians) to range 0 > 2*PI
equals
public boolean equals(double a)
 are two angles equal? RADIANS
greaterThan
public boolean greaterThan(double a)
 is one angle greater than another (after normalisation)
greaterThanOrEquals
public boolean greaterThanOrEquals(double a)
 is one angle greater than or equal to another (after normalisation)
lessThan
public boolean lessThan(double a)
 is one angle less than another (after normalisation)
lessThanOrEquals
public boolean lessThanOrEquals(double a)
 is one angle less than or equal to another (after normalisation)
equals
public boolean equals(Angle a)
 are two angles equal?
greaterThan
public boolean greaterThan(Angle a)
 is one angle greater than another (after normalisation)
greaterThanOrEquals
public boolean greaterThanOrEquals(Angle a)
 is one angle greater than or equal to another (after normalisation)
lessThan
public boolean lessThan(Angle a)
 is one angle less than another (after normalisation)
lessThanOrEquals
public boolean lessThanOrEquals(Angle a)
 is one angle less than or equal to another (after normalisation)
getAngle
public double getAngle()
 get angle in radians
getRadian
public double getRadian()
 get angle in radians
getDegrees
public double getDegrees()
 get angle in degrees
putDegrees
public void putDegrees(double a)
 input angle in degrees
setRange
public void setRange(AngleRange type)
 set type of range
toString
public String toString()
 Overrides:
 toString in class Object
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index