|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGeometry
public class Geometry
Class to hold methods for doing simple geometry All methods are static (class) methods. You do not need to create an object of the Geometry class to use these methods.
Constructor Summary | |
---|---|
Geometry()
|
Method Summary | |
---|---|
static double |
getDistance(double x1,
double y1,
double x2,
double y2)
Method to get the distance between two points |
static java.awt.Point |
getPointAtDistance(int x1,
int y1,
double heading,
double distance)
Method to get a new point at a given distance from an old point along a heading (angle in degrees) |
static java.awt.Point |
getPointAtDistance(java.awt.Point startPoint,
double heading,
double distance)
Method to get a new point at a given distance from an old point along a heading (angle in degrees) |
static double |
getSlope(double x1,
double y1,
double x2,
double y2)
Method to get the slope between two points |
static double |
getSlopeAngle(double x1,
double y1,
double x2,
double y2)
Method to get the slope angle between 2 points The slope angle is the interior angle of the triange of the slope line with the y and x axis. |
static double |
getTurtleHeading(double x1,
double y1,
double x2,
double y2)
Method to return the heading for a turtle which uses 0 degrees as north |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Geometry()
Method Detail |
---|
public static double getSlope(double x1, double y1, double x2, double y2)
x1
- the x value for one of the pointsy1
- the y value for one of the pointsx2
- the x value for a second pointy2
- the y value for a second point
public static double getSlopeAngle(double x1, double y1, double x2, double y2)
x1
- the x value for one of the pointsy1
- the y value for one of the pointsx2
- the x value for a second pointy2
- the y value for a second point
public static double getTurtleHeading(double x1, double y1, double x2, double y2)
x1
- x from the first pointy1
- y from the first pointx2
- x from the second pointy2
- y from the second point
public static java.awt.Point getPointAtDistance(int x1, int y1, double heading, double distance)
x1
- x of a pointy1
- y of a pointheading
- the heading in degrees with north
being 0 and south 180distance
- the distance for the returned point
public static java.awt.Point getPointAtDistance(java.awt.Point startPoint, double heading, double distance)
startPoint
- the point to get the distance
fromheading
- the heading in degrees with north
being 0 and south 180distance
- the distance for the returned point
public static double getDistance(double x1, double y1, double x2, double y2)
x1
- x value of first pointy1
- y value of first pointx2
- x value of second pointy2
- y value of second point
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |