CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.geom3d
Class Point3D

java.lang.Object
  extended by ch.randelshofer.geom3d.Point3D
All Implemented Interfaces:
java.lang.Cloneable

public class Point3D
extends java.lang.Object
implements java.lang.Cloneable

A point representing a location in (x, y, z) coordinate space.

Version:
1.0 2009-01-04 Added method planeEquation. 0.2 1999-1-1 Package renamed.
0.1 1998-12-15 Released.
0.0 1998-02-15 Created.
Author:
Werner Randelshofer, Hausmatt 10 ,6405 Immensee

Field Summary
 double x
          The x coordinate of the point.
 double y
          The y coordinate of the point.
 double z
          The z coordinate of the point.
 
Constructor Summary
Point3D()
          Constructs and initializes a Point with 0, 0, 0.
Point3D(double x, double y, double z)
          Constructs and initializes a Point with the specified coordinates.
 
Method Summary
 Point3D clone()
           
static double dotProduct(Point3D a, Point3D b)
          dotProduct product of 2 vectors.
 double getX()
          Returns the X coordinate of the point in double precision.
 double getY()
          Returns the Y coordinate of the point in double precision.
 double getZ()
          Returns the Z coordinate of the point in double precision.
 double length()
          Length of this vector.
 Point3D normalize()
          Normalizes the vector.
static double[] planeEquation(Point3D v1, Point3D v2, Point3D v3)
          Computes the plane equation a*x + b*y + c*z + d = 0 from three given points in space.
static Point3D sub(Point3D a, Point3D b)
          subtracts 2 vectors.
 java.lang.String toString()
          Returns a String that represents the value of this Object.
static Point3D vectorProduct(Point3D a, Point3D b)
          returns a x b.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x
The x coordinate of the point.


y

public double y
The y coordinate of the point.


z

public double z
The z coordinate of the point.

Constructor Detail

Point3D

public Point3D()
Constructs and initializes a Point with 0, 0, 0.


Point3D

public Point3D(double x,
               double y,
               double z)
Constructs and initializes a Point with the specified coordinates.

Method Detail

toString

public java.lang.String toString()
Returns a String that represents the value of this Object.

Overrides:
toString in class java.lang.Object

getX

public double getX()
Returns the X coordinate of the point in double precision.


getY

public double getY()
Returns the Y coordinate of the point in double precision.


getZ

public double getZ()
Returns the Z coordinate of the point in double precision.


planeEquation

public static double[] planeEquation(Point3D v1,
                                     Point3D v2,
                                     Point3D v3)
Computes the plane equation a*x + b*y + c*z + d = 0 from three given points in space.

Parameters:
v1 -
v2 -
v3 -

vectorProduct

public static Point3D vectorProduct(Point3D a,
                                    Point3D b)
returns a x b.


dotProduct

public static double dotProduct(Point3D a,
                                Point3D b)
dotProduct product of 2 vectors.


sub

public static Point3D sub(Point3D a,
                          Point3D b)
subtracts 2 vectors.


normalize

public Point3D normalize()
Normalizes the vector.


length

public double length()
Length of this vector.


clone

public Point3D clone()
Overrides:
clone in class java.lang.Object

(c) Werner Randelshofer.
All rights reserved.