Class pmr.euclid.Point3
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.euclid.Point3
java.lang.Object
|
+----pmr.euclid.Status
|
+----pmr.euclid.Point3
- public class Point3
- extends Status
Point3 - 3-dimensional point class
Point3 represents a 3-dimensional point. It is one of a set of
primitives which can be combined to create and manipulate complex
3-dimensional objects. Points can be transformed with rotation
matrices or rotation-translation matrices (Transform3), can
be calculated from other primitives or can be used to generate other
primitives.
Default point is 0.0, 0.0, 0.0
- Author:
- Peter Murray-Rust, (C) P. Murray-Rust, 1996
- See Also:
- Vector3, Line3, Point3Vector, Plane3
-
flarray
- the coordinates of the point
-
Point3()
-
-
Point3(double, double, double)
- formed from point components
-
Point3(double[])
- constructor from a double[] (or a RealArray)
-
Point3(Point3)
- copy constructor
-
Point3(Vector3)
- make a point from a vector
-
clone(double[])
- overloaded assignment from a double[] (or a RealArray)
-
clone(Point3)
-
-
clone(Vector3)
- from Vector3
-
distanceFromLine(Line3)
-
-
distanceFromPlane(Plane3)
-
-
divideBy(double)
-
-
elementAt(int)
- subscript operator counts from ZERO
-
equals(Point3)
- are two points identical?
-
getAngle(Point3, Point3, Point3)
- angle (p1-p2-p3; vertex is p2)
-
getArray()
- get components as double[]
-
getClosestPointOnLine(Line3)
-
-
getDistanceFromOrigin()
- distance of point from origin
-
getDistanceFromPoint(Point3)
- distance of point from another point
-
getMidPoint(Point3)
- mid-point of two points
-
getTorsion(Point3, Point3, Point3, Point3)
- torsion angle
-
isOrigin()
- is a point at Origin?
-
main(String[])
- tests Point3 routines = new Point3
-
multiplyBy(double)
- scale point
-
plus(Point3)
- New point from point+point - used for finding centrois, etc.
-
plus(Vector3)
- New point from point+vector
-
subtract(Point3)
- vector between two points
-
subtract(Vector3)
- New point from point-vector
-
toString()
-
-
transform(Transform3)
- transform a point; does NOT modify 'this'
flarray
protected double flarray[]
- the coordinates of the point
Point3
public Point3()
Point3
public Point3(double x,
double y,
double z)
- formed from point components
Point3
public Point3(Point3 p)
- copy constructor
Point3
public Point3(double f[])
- constructor from a double[] (or a RealArray)
Point3
public Point3(Vector3 v)
- make a point from a vector
- Returns:
- creates the point at head of vector rooted at the origin
clone
public Point3 clone(Point3 p)
clone
public Point3 clone(double f[])
- overloaded assignment from a double[] (or a RealArray)
getArray
public double[] getArray()
- get components as double[]
clone
public Point3 clone(Vector3 v)
- from Vector3
equals
public boolean equals(Point3 p)
- are two points identical?
subtract
public Vector3 subtract(Point3 p2)
- vector between two points
plus
public Point3 plus(Point3 p)
- New point from point+point - used for finding centrois, etc.
plus
public Point3 plus(Vector3 v)
- New point from point+vector
subtract
public Point3 subtract(Vector3 v)
- New point from point-vector
multiplyBy
public Point3 multiplyBy(double f)
- scale point
divideBy
public Point3 divideBy(double f)
elementAt
public double elementAt(int n)
- subscript operator counts from ZERO
transform
public Point3 transform(Transform3 t)
- transform a point; does NOT modify 'this'
getDistanceFromOrigin
public double getDistanceFromOrigin()
- distance of point from origin
getDistanceFromPoint
public double getDistanceFromPoint(Point3 p2)
- distance of point from another point
distanceFromPlane
public double distanceFromPlane(Plane3 pl)
getClosestPointOnLine
public Point3 getClosestPointOnLine(Line3 l)
- Parameters:
- l - any line
- Returns:
- the point p on line l where this-p
distance is shortest
distanceFromLine
public double distanceFromLine(Line3 l)
getMidPoint
public Point3 getMidPoint(Point3 p2)
- mid-point of two points
getAngle
public static Angle getAngle(Point3 p1,
Point3 p2,
Point3 p3) throws ZeroLengthVectorException
- angle (p1-p2-p3; vertex is p2)
- Throws: ZeroLengthVectorException
- two points are coincident
getTorsion
public static Angle getTorsion(Point3 p1,
Point3 p2,
Point3 p3,
Point3 p4) throws ZeroLengthVectorException
- torsion angle
- Throws: ZeroLengthVectorException
- two points are coincident or three points are colinear
isOrigin
public boolean isOrigin()
- is a point at Origin?
toString
public String toString()
- Overrides:
- toString in class Object
main
public static void main(String args[])
- tests Point3 routines = new Point3
All Packages Class Hierarchy This Package Previous Next Index