|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.geometry.GeometryLib
public class GeometryLib
Various basic double-based geometry functions.
| Field Summary | |
|---|---|
static double |
eighteenthpi
|
static double |
feettometers
|
static double |
halfpi
|
static double |
meterstofeet
|
static double |
pi
|
static double |
threehalfpi
|
static double |
twopi
|
| Constructor Summary | |
|---|---|
GeometryLib()
|
|
| Method Summary | |
|---|---|
static double |
angle(double x1,
double y1,
double x2,
double y2)
Returns the angle of a line. |
static double |
angle(Point p1,
Point p2)
Returns the angle of a line. |
static double |
angleBetween(double theta1,
double theta2)
Calculates the shortest difference, in canonical radians, between two angles. |
static double |
calculateAngle(Point junior,
Point pops)
Calculates the angle in radians of the line from pops->junior |
static TurnVector |
calculateVector(Point junior,
Point pops,
Point gramps)
Calculates the turn vector (distance + angle) of the line from pops->junior as compared to the line from gramps->pops. |
static TurnVector |
calculateVectorFromNorth(Point junior,
Point pops)
Calculates the turn vector (distance + angle) of the line from pops->junior as compared to the line from due south to pops. |
static double |
canonicalAngle(double original)
Translates an angle in radians into canonical (0 < theta < 2*pi) |
static boolean |
covers(double x1,
double y1,
double width1,
double height1,
double x2,
double y2,
double width2,
double height2)
Returns true if the first rectangle completely covers the second. |
static double |
deflectionAngle(double original)
Translates an angle in radians into deflection (-pi < theta < pi) |
static double |
degreesToRadians(double degrees)
Translates an angle in degrees to an angle in radians. |
static double |
distance(double x1,
double y1,
double x2,
double y2)
Returns the distance between two points. |
static double |
distance(Point p1,
Point p2)
Returns the distance between two points. |
static double |
distance2(double x1,
double y1,
double x2,
double y2)
Returns the square of the distance between two points. |
static double |
feetToMeters(double feet)
|
static double |
getSlope(double x1,
double y1,
double x2,
double y2)
|
static boolean |
inside(double x1,
double y1,
double width,
double height,
double x2,
double y2)
Returns true if the coordinate is inside the rectangle. |
static double |
makeDiameterEvenMultiple(double original,
double partLength)
Given a diameter and a part length, returns the diameter closest to the given one such that the new circumference is an even multiple of the part length. |
static double |
metersToFeet(double meters)
|
static boolean |
overlaps(double x1,
double y1,
double width1,
double height1,
double x2,
double y2,
double width2,
double height2)
Returns true if the given rectangles overlap. |
static double |
radiansToDegrees(double radians)
Translates an angle in radians into an angle in degrees. |
static double |
roundAngle(double original)
|
static double |
roundAngle(double original,
int divisions)
|
static Point |
shootBearingAndRange(double x,
double y,
double bearing,
double range)
Calculates a second point using bearing and range. |
static double |
slope(double x1,
double x2,
double y1,
double y2)
Returns the slope of a line. |
static double |
solveForX(double x1,
double y1,
double x2,
double y2,
double newY)
|
static double |
solveForY(double x1,
double y1,
double x2,
double y2,
double newX)
|
| 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
public static final double twopi
public static final double halfpi
public static final double threehalfpi
public static final double eighteenthpi
public static final double feettometers
public static final double meterstofeet
| Constructor Detail |
|---|
public GeometryLib()
| Method Detail |
|---|
public static final double solveForX(double x1,
double y1,
double x2,
double y2,
double newY)
public static final double solveForY(double x1,
double y1,
double x2,
double y2,
double newX)
public static final double getSlope(double x1,
double y1,
double x2,
double y2)
public static double roundAngle(double original)
public static double roundAngle(double original,
int divisions)
public static double canonicalAngle(double original)
public static double angleBetween(double theta1,
double theta2)
public static double deflectionAngle(double original)
public static double radiansToDegrees(double radians)
public static double degreesToRadians(double degrees)
public static TurnVector calculateVectorFromNorth(Point junior,
Point pops)
public static TurnVector calculateVector(Point junior,
Point pops,
Point gramps)
public static double calculateAngle(Point junior,
Point pops)
public static Point shootBearingAndRange(double x,
double y,
double bearing,
double range)
public static boolean overlaps(double x1,
double y1,
double width1,
double height1,
double x2,
double y2,
double width2,
double height2)
public static boolean covers(double x1,
double y1,
double width1,
double height1,
double x2,
double y2,
double width2,
double height2)
public static boolean inside(double x1,
double y1,
double width,
double height,
double x2,
double y2)
public static double distance(Point p1,
Point p2)
public static double distance(double x1,
double y1,
double x2,
double y2)
public static double distance2(double x1,
double y1,
double x2,
double y2)
public static double angle(double x1,
double y1,
double x2,
double y2)
public static double angle(Point p1,
Point p2)
public static double slope(double x1,
double x2,
double y1,
double y2)
public static double makeDiameterEvenMultiple(double original,
double partLength)
public static double feetToMeters(double feet)
public static double metersToFeet(double meters)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||