|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vividsolutions.jts.algorithm.Angle
Utility functions for working with angles. Unless otherwise noted, methods in this class express angles in radians.
| Field Summary | |
static int |
CLOCKWISE
Constant representing clockwise orientation |
static int |
COUNTERCLOCKWISE
Constant representing counterclockwise orientation |
static int |
NONE
Constant representing no orientation |
static double |
PI_OVER_2
|
static double |
PI_OVER_4
|
static double |
PI_TIMES_2
|
| Constructor Summary | |
Angle()
|
|
| Method Summary | |
static double |
angle(Coordinate p)
Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. |
static double |
angle(Coordinate p0,
Coordinate p1)
Returns the angle of the vector from p0 to p1, relative to the positive X-axis. |
static double |
angleBetween(Coordinate tip1,
Coordinate tail,
Coordinate tip2)
Returns the smallest angle between two vectors. |
static double |
diff(double ang1,
double ang2)
Computes the unoriented (smallest) difference between two angles. |
static int |
getTurn(double ang1,
double ang2)
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. |
static double |
interiorAngle(Coordinate p0,
Coordinate p1,
Coordinate p2)
Computes the interior angle between two segments of a ring. |
static boolean |
isAcute(Coordinate p0,
Coordinate p1,
Coordinate p2)
Tests whether the angle between p0-p1-p2 is acute. |
static boolean |
isObtuse(Coordinate p0,
Coordinate p1,
Coordinate p2)
Tests whether the angle between p0-p1-p2 is obtuse. |
static double |
normalize(double angle)
Computes the normalized value of an angle, which is the equivalent angle in the range [ -Pi, Pi ]. |
static double |
normalizePositive(double angle)
Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ]. |
static double |
toDegrees(double radians)
Converts from radians to degrees. |
static double |
toRadians(double angleDegrees)
Converts from degrees to radians. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final double PI_TIMES_2
public static final double PI_OVER_2
public static final double PI_OVER_4
public static final int COUNTERCLOCKWISE
public static final int CLOCKWISE
public static final int NONE
| Constructor Detail |
public Angle()
| Method Detail |
public static double toDegrees(double radians)
radians - an angle in radians
public static double toRadians(double angleDegrees)
angleDegrees - an angle in degrees
public static double angle(Coordinate p0,
Coordinate p1)
public static double angle(Coordinate p)
public static boolean isAcute(Coordinate p0,
Coordinate p1,
Coordinate p2)
p0 - an endpoint of the anglep1 - the base of the anglep2 - the other endpoint of the angle
public static boolean isObtuse(Coordinate p0,
Coordinate p1,
Coordinate p2)
p0 - an endpoint of the anglep1 - the base of the anglep2 - the other endpoint of the angle
public static double angleBetween(Coordinate tip1,
Coordinate tail,
Coordinate tip2)
tip1 - the tip of one vectortail - the tail of each vectortip2 - the tip of the other vector
public static double interiorAngle(Coordinate p0,
Coordinate p1,
Coordinate p2)
p0 - a point of the ringp1 - the next point of the ringp2 - the next point of the ring
p1
public static int getTurn(double ang1,
double ang2)
ang1 - an angle (in radians)ang2 - an angle (in radians)
public static double normalize(double angle)
angle - the angle to normalize
public static double normalizePositive(double angle)
angle - the angle to normalize, in radians
public static double diff(double ang1,
double ang2)
ang1 - the angle of one vector (in [-Pi, Pi] )ang2 - the angle of the other vector (in range [-Pi, Pi] )
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||