public class Angle extends Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
Angle() |
| Modifier and Type | Method and Description |
|---|---|
static double |
angle(double x,
double y)
Calculate the angle of a coordinates
|
static double |
angle(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Calculate the angle between three coordinates.
|
static double |
angle(Point p)
Returns the angle that the vector from (0,0) to p,
relative to the positive X-axis.
|
static double |
angle(Point p1,
Point p2,
Point p3) |
static double |
angle2d(double x1,
double x2,
double y1,
double y2) |
static double |
angleBetween(Point tip1,
Point tail,
Point tip2)
Returns the unoriented smallest angle between two vectors.
|
static double |
angleBetweenOriented(Point tip1,
Point tail,
Point tip2)
Returns the oriented smallest angle between two vectors.
|
static double |
angleDegrees(double x1,
double y1,
double x2,
double y2) |
static double |
angleDiff(double ang1,
double ang2) |
static double |
angleDiff(double angle1,
double angle2,
boolean clockwise) |
static double |
angleDiffDegrees(double a,
double b) |
static double |
angleNorthDegrees(double x1,
double y1,
double x2,
double y2) |
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(Point p0,
Point p1,
Point p2)
Computes the interior angle between two segments of a ring.
|
static boolean |
isAcute(Point p0,
Point p1,
Point p2)
Tests whether the angle between p0-p1-p2 is acute.
|
static boolean |
isObtuse(Point p0,
Point p1,
Point 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.
|
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
public static double angle(double x,
double y)
x - The x coordinate.y - The y coordinate.public static double angle(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
x1 - The first x coordinate.y1 - The first y coordinate.x2 - The second x coordinate.y2 - The second y coordinate.x3 - The third x coordinate.y3 - The third y coordinate.public static double angle(Point p)
public static double angle2d(double x1,
double x2,
double y1,
double y2)
public static double angleBetween(Point tip1, Point tail, Point tip2)
tip1 - the tip of one vectortail - the tail of each vectortip2 - the tip of the other vectorpublic static double angleBetweenOriented(Point tip1, Point tail, Point tip2)
tip1 - the tip of v1tail - the tail of each vectortip2 - the tip of v2public static double angleDegrees(double x1,
double y1,
double x2,
double y2)
public static double angleDiff(double ang1,
double ang2)
public static double angleDiff(double angle1,
double angle2,
boolean clockwise)
public static double angleDiffDegrees(double a,
double b)
public static double angleNorthDegrees(double x1,
double y1,
double x2,
double y2)
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] )public static int getTurn(double ang1,
double ang2)
ang1 - an angle (in radians)ang2 - an angle (in radians)public static double interiorAngle(Point p0, Point p1, Point p2)
p0 - a point of the ringp1 - the next point of the ringp2 - the next point of the ringp1public static boolean isAcute(Point p0, Point p1, Point p2)
Note: this implementation is not precise (determistic) for angles very close to 90 degrees.
p0 - an endpoint of the anglep1 - the base of the anglep2 - the other endpoint of the anglepublic static boolean isObtuse(Point p0, Point p1, Point p2)
Note: this implementation is not precise (determistic) for angles very close to 90 degrees.
p0 - an endpoint of the anglep1 - the base of the anglep2 - the other endpoint of the anglepublic static double normalize(double angle)
angle - the angle to normalizepublic static double normalizePositive(double angle)
angle - the angle to normalize, in radianspublic static double toDegrees(double radians)
radians - an angle in radianspublic static double toRadians(double angleDegrees)
angleDegrees - an angle in degreesCopyright © 2015 Revolution Systems Inc.. All rights reserved.