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

Variable Index

 o flarray
the coordinates of the point

Constructor Index

 o Point3()
 o Point3(double, double, double)
formed from point components
 o Point3(double[])
constructor from a double[] (or a RealArray)
 o Point3(Point3)
copy constructor
 o Point3(Vector3)
make a point from a vector

Method Index

 o clone(double[])
overloaded assignment from a double[] (or a RealArray)
 o clone(Point3)
 o clone(Vector3)
from Vector3
 o distanceFromLine(Line3)
 o distanceFromPlane(Plane3)
 o divideBy(double)
 o elementAt(int)
subscript operator counts from ZERO
 o equals(Point3)
are two points identical?
 o getAngle(Point3, Point3, Point3)
angle (p1-p2-p3; vertex is p2)
 o getArray()
get components as double[]
 o getClosestPointOnLine(Line3)
 o getDistanceFromOrigin()
distance of point from origin
 o getDistanceFromPoint(Point3)
distance of point from another point
 o getMidPoint(Point3)
mid-point of two points
 o getTorsion(Point3, Point3, Point3, Point3)
torsion angle
 o isOrigin()
is a point at Origin?
 o main(String[])
tests Point3 routines = new Point3
 o multiplyBy(double)
scale point
 o plus(Point3)
New point from point+point - used for finding centrois, etc.
 o plus(Vector3)
New point from point+vector
 o subtract(Point3)
vector between two points
 o subtract(Vector3)
New point from point-vector
 o toString()
 o transform(Transform3)
transform a point; does NOT modify 'this'

Variables

 o flarray
  protected double flarray[]
the coordinates of the point

Constructors

 o Point3
  public Point3()
 o Point3
  public Point3(double x,
                double y,
                double z)
formed from point components
 o Point3
  public Point3(Point3 p)
copy constructor
 o Point3
  public Point3(double f[])
constructor from a double[] (or a RealArray)
 o Point3
  public Point3(Vector3 v)
make a point from a vector
Returns:
creates the point at head of vector rooted at the origin

Methods

 o clone
  public Point3 clone(Point3 p)
 o clone
  public Point3 clone(double f[])
overloaded assignment from a double[] (or a RealArray)
 o getArray
  public double[] getArray()
get components as double[]
 o clone
  public Point3 clone(Vector3 v)
from Vector3
 o equals
  public boolean equals(Point3 p)
are two points identical?
 o subtract
  public Vector3 subtract(Point3 p2)
vector between two points
 o plus
  public Point3 plus(Point3 p)
New point from point+point - used for finding centrois, etc.
 o plus
  public Point3 plus(Vector3 v)
New point from point+vector
 o subtract
  public Point3 subtract(Vector3 v)
New point from point-vector
 o multiplyBy
  public Point3 multiplyBy(double f)
scale point
 o divideBy
  public Point3 divideBy(double f)
 o elementAt
  public double elementAt(int n)
subscript operator counts from ZERO
 o transform
  public Point3 transform(Transform3 t)
transform a point; does NOT modify 'this'
 o getDistanceFromOrigin
  public double getDistanceFromOrigin()
distance of point from origin
 o getDistanceFromPoint
  public double getDistanceFromPoint(Point3 p2)
distance of point from another point
 o distanceFromPlane
  public double distanceFromPlane(Plane3 pl)
 o getClosestPointOnLine
  public Point3 getClosestPointOnLine(Line3 l)
Parameters:
l - any line
Returns:
the point p on line l where this-p distance is shortest
 o distanceFromLine
  public double distanceFromLine(Line3 l)
 o getMidPoint
  public Point3 getMidPoint(Point3 p2)
mid-point of two points
 o 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
 o 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
 o isOrigin
  public boolean isOrigin()
is a point at Origin?
 o toString
  public String toString()
Overrides:
toString in class Object
 o main
  public static void main(String args[])
tests Point3 routines = new Point3

All Packages  Class Hierarchy  This Package  Previous  Next  Index