|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectPoint
public class Point
An n-dimensional geometric point, with convenience methods for those who prefer to live in 2-, 3-, or 4-D space and several static methods dealing with small numbers of Points (in 2D, plus 1 method for 3D). Names for some of these methods come from: O'Rourke, _Computational Geometry in C_
| Constructor Summary | |
|---|---|
Point(double[] v)
Constructor for an nD point. |
|
Point(double x,
double y)
Constructor for a 2D Point. |
|
Point(double x,
double y,
double z)
Constructor for a 3D Point. |
|
Point(double x,
double y,
double z,
double w)
Constructor for a 4D Point. |
|
| Method Summary | |
|---|---|
static double |
area2(Point a,
Point b,
Point c)
Twice the signed area of the (2D) triangle abc. |
boolean |
between(Point a,
Point b)
Is this (2D) Point on the interior of the line segment ab. |
boolean |
collinear(Point a,
Point b)
Is this (2D) Point on the line determined by a and b. |
boolean |
collinear3(Point a,
Point b)
Is this (3D) Point on the line determined by a and b |
double |
coord(int c)
An individual coordinate. |
int |
dimension()
The dimension. |
double |
distanceL1(Point a)
The distance to another point using the L1 norm. |
double |
distanceL2(Point a)
The distance to another point using the L2 norm. |
double |
distanceL2squared(Point a)
The distance to another point using the L2 norm squared. |
static boolean |
intersect(Point a,
Point b,
Point c,
Point d)
Does the (2D) line segment ab intersect cd (grazing intersections are allowed). |
static boolean |
intersectProp(Point a,
Point b,
Point c,
Point d)
Does the (2D) line segment ab properly intersect line segment cd. |
boolean |
left(Point a,
Point b)
Is this (2D) Point strictly to the left of the oriented line determined by a and b. |
boolean |
leftOn(Point a,
Point b)
Is this (2D) Point to the left or on the oriented line determined by a and b. |
java.lang.String |
toString()
Format the point. |
java.lang.String |
toString(java.lang.String df)
Format the point using a hint. |
static double |
volume6(Point a,
Point b,
Point c,
Point d)
Six times the signed volume of the (3D) tetrahedron abcd. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Point(double x,
double y)
x - the x-coordinatey - the y-coordinate
public Point(double x,
double y,
double z)
x - the x-coordinatey - the y-coordinatez - the z-coordinate
public Point(double x,
double y,
double z,
double w)
x - the x-coordinatey - the y-coordinatez - the z-coordinatew - the z-coordinatepublic Point(double[] v)
v - coordinates| Method Detail |
|---|
public java.lang.String toString(java.lang.String df)
df - the format to be used for a single coordinatepublic java.lang.String toString()
toString in class java.lang.Objectpublic double distanceL1(Point a)
a - the other pointpublic double distanceL2(Point a)
a - the other pointpublic double distanceL2squared(Point a)
a - the other pointpublic double coord(int c)
c - the index of the desired coordinatepublic int dimension()
public boolean left(Point a,
Point b)
a - the first point on the lineb - the second point on the line
public boolean leftOn(Point a,
Point b)
a - the first point on the lineb - the second point on the line
public boolean collinear(Point a,
Point b)
a - the first point on the lineb - the second point on the line
public boolean collinear3(Point a,
Point b)
a - the first point on the lineb - the second point on the line
public boolean between(Point a,
Point b)
a - the first point of the line segment.b - the second of the line segment.
public static double area2(Point a,
Point b,
Point c)
a - the first pointb - the second pointc - the third point
public static double volume6(Point a,
Point b,
Point c,
Point d)
a - the first pointb - the second pointc - the third pointd - the fourth point
public static boolean intersectProp(Point a,
Point b,
Point c,
Point d)
a - the first point on the first line segmentb - the second point on the first line segmentc - the first point on the second line segmentd - the second point on the second line segment
public static boolean intersect(Point a,
Point b,
Point c,
Point d)
a - the first point on the first line segmentb - the second point on the first line segmentc - the first point on the second line segmentd - the second point on the second line segment
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||