|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--jumbo.euclid.Status
|
+--jumbo.euclid.Angle
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.
| Field Summary | |
static AngleType |
DEGREES
|
static double |
DEGREES_IN_RADIAN
|
static AngleType |
RADIANS
set Radians or degrees for output |
static jumbo.euclid.AngleRange |
SIGNED
-PI to PI |
static jumbo.euclid.AngleRange |
UNLIMITED
Any value |
static jumbo.euclid.AngleRange |
UNSIGNED
0 to 2*PI |
| Constructor Summary | |
Angle()
create deafult Angle (0.0) |
|
Angle(Angle a)
copy constructor |
|
Angle(double a)
create an angle IN RADIANS |
|
Angle(double a,
AngleType units)
construct using degrees or radians |
|
Angle(double x,
double y)
from X and Y components (uses atan2) |
|
| Method Summary | |
Angle |
clone(Angle a)
|
double |
cos()
trigonometric functions |
boolean |
equals(Angle a)
are two angles equal? |
boolean |
equals(double a)
are two angles equal? RADIANS |
double |
getAngle()
get angle in radians |
double |
getDegrees()
get angle in degrees |
double |
getRadian()
get angle in radians |
boolean |
greaterThan(Angle a)
is one angle greater than another (after normalisation) |
boolean |
greaterThan(double a)
is one angle greater than another (after normalisation) |
boolean |
greaterThanOrEquals(Angle a)
is one angle greater than or equal to another (after normalisation) |
boolean |
greaterThanOrEquals(double a)
is one angle greater than or equal to another (after normalisation) |
boolean |
lessThan(Angle a)
is one angle less than another (after normalisation) |
boolean |
lessThan(double a)
is one angle less than another (after normalisation) |
boolean |
lessThanOrEquals(Angle a)
is one angle less than or equal to another (after normalisation) |
boolean |
lessThanOrEquals(double a)
is one angle less than or equal to another (after normalisation) |
static void |
main(java.lang.String[] args)
|
Angle |
multiplyBy(double f)
multiply an angle by a scalar |
static double |
normalise(double angle)
normalise angle (in radians) to range 0 -> 2*PI |
Angle |
plus(Angle a2)
add two angles |
void |
putDegrees(double a)
input angle in degrees |
void |
setRange(jumbo.euclid.AngleRange type)
set type of range |
void |
shallowCopy(Angle a)
shallowCopy |
double |
sin()
|
Angle |
subtract(Angle a2)
subtract two angles |
double |
tan()
|
java.lang.String |
toString()
|
| Methods inherited from class jumbo.euclid.Status |
NYI |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final jumbo.euclid.AngleRange UNLIMITED
public static final jumbo.euclid.AngleRange UNSIGNED
public static final jumbo.euclid.AngleRange SIGNED
public static final AngleType RADIANS
public static final AngleType DEGREES
public static final double DEGREES_IN_RADIAN
| Constructor Detail |
public Angle()
public Angle(double a)
public Angle(double a,
AngleType units)
public Angle(double x,
double y)
public Angle(Angle a)
| Method Detail |
public void shallowCopy(Angle a)
public Angle clone(Angle a)
public Angle plus(Angle a2)
public Angle subtract(Angle a2)
public Angle multiplyBy(double f)
public double cos()
public double sin()
public double tan()
public static double normalise(double angle)
public boolean equals(double a)
public boolean greaterThan(double a)
public boolean greaterThanOrEquals(double a)
public boolean lessThan(double a)
public boolean lessThanOrEquals(double a)
public boolean equals(Angle a)
public boolean greaterThan(Angle a)
public boolean greaterThanOrEquals(Angle a)
public boolean lessThan(Angle a)
public boolean lessThanOrEquals(Angle a)
public double getAngle()
public double getRadian()
public double getDegrees()
public void putDegrees(double a)
public void setRange(jumbo.euclid.AngleRange type)
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||