|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ProGAL.geomNd.Point
public class Point
A class representing a point in an N-dimensional Euclidean space. The underlying representation is a double-array. Changes to the elements of this double-array will also result in a change to the point. The double-array can be specified on construction and can be retrieved lated.
Constructor Summary | |
---|---|
Point(double[] coords)
|
|
Point(int dimensions)
|
|
Point(Point p)
|
Method Summary | |
---|---|
Point |
addThis(Vector v)
Add the specified vector to this point. |
Point |
clone()
|
static boolean |
collinear(Point p1,
Point p2,
Point p3)
|
double |
distance()
Returns distance to the origo |
double |
distance(Point p)
Returns distance to the point p |
double |
distanceSquared()
Returns squared distance to the origo |
double |
distanceSquared(Point p)
Returns squared distance to the point p |
double |
distanceSquaredXY()
Returns the squared distance to the origo of this point projected onto xy plane |
double |
distanceXY()
Returns the distance to the origo of this point projected onto xy plane |
double |
dot(Point p)
|
double |
get(int d)
Get the d'th coordinate. |
static double |
getAngle(Point p1,
Point p2,
Point p3)
|
double |
getCoord(int d)
Get the d'th coordinate. |
double[] |
getCoords()
Get all coordinates in an array. |
int |
getDimensions()
Return the dimensionality of this point. |
static Point |
getMidpoint(Point p,
Point q)
Creates the midpoint of two points. |
Point |
multiplyThis(double s)
Scale this point by the specified value |
double |
polarAngleCosXY()
Returns the cosinus of the polar angle of this point projected onto xy plane |
double |
polarAngleSinXY()
Returns the sinus of the polar angle of this point projected onto xy plane |
double |
polarAngleXY()
Returns polar angle of this point projected onto xy plane |
void |
set(int d,
double v)
Set the d'th coordinate. |
Point |
set(Point p)
Set the coordinates to be identical to those in the specified point. |
void |
setCoord(int d,
double v)
Set the d'th coordinate. |
Point |
setCoord(Point p)
Set the coordinates to be identical to those in the specified point. |
void |
toConsole()
|
void |
toConsole(int dec)
|
java.lang.String |
toString()
|
java.lang.String |
toString(int dec)
|
Vector |
toVector()
|
Vector |
vectorTo(Point p1)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Point(Point p)
public Point(double[] coords)
public Point(int dimensions)
Method Detail |
---|
public double get(int d)
public double getCoord(int d)
public double[] getCoords()
public int getDimensions()
public void set(int d, double v)
public void setCoord(int d, double v)
public Point set(Point p)
p
and this
are not the same, then the largest possible number of
coordinates are copied
public Point setCoord(Point p)
p
and this
are not the same, then the largest possible number of
coordinates are copied.
public Point addThis(Vector v)
public Point multiplyThis(double s)
public double distanceSquared(Point p)
public double distanceSquared()
public double distance(Point p)
public double dot(Point p)
public double distance()
public static Point getMidpoint(Point p, Point q)
public static boolean collinear(Point p1, Point p2, Point p3)
public static double getAngle(Point p1, Point p2, Point p3)
public double distanceSquaredXY()
public double distanceXY()
public double polarAngleSinXY()
public double polarAngleCosXY()
public double polarAngleXY()
public Vector vectorTo(Point p1)
public Vector toVector()
public Point clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int dec)
public void toConsole()
public void toConsole(int dec)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |