edu.stanford.rsl.konrad.geometry.splines.capi
Class CAPIPoint3D

java.lang.Object
  extended by edu.stanford.rsl.konrad.geometry.splines.capi.CAPIPoint3D
All Implemented Interfaces:
com.graphbuilder.curve.CurvePoint, com.graphbuilder.geom.Point2d, com.graphbuilder.geom.Point3d

public class CAPIPoint3D
extends java.lang.Object
implements com.graphbuilder.geom.Point3d, com.graphbuilder.curve.CurvePoint

Class that modes a 3D Point in space. Compatible with java.awt.Point and com.graphbuilder

Author:
akmaier

Constructor Summary
CAPIPoint3D(double x, double y, double z)
           
CAPIPoint3D(PointND p)
           
 
Method Summary
 double distance(CAPIPoint3D two)
          computes the Euclidean distance between the current point $\mathbf{x_1} = (x_1, y_1, z_1)$ the the point "two" $\mathbf{x_2} = (x_2, y_2, z_2)$ as $|| \\mathbf{x_1} - \\mathbf{x_2} || = \\sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2 + (z_1 - z_2)^2}$.
 double[] getLocationAsDoubleArray()
           
 double getX()
           
 double getY()
           
 double getZ()
           
 void setLocation(double[] p)
           
 void setLocation(double x, double y)
           
 void setLocation(double x, double y, double z)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CAPIPoint3D

public CAPIPoint3D(double x,
                   double y,
                   double z)

CAPIPoint3D

public CAPIPoint3D(PointND p)
Method Detail

getX

public double getX()
Specified by:
getX in interface com.graphbuilder.geom.Point2d

getY

public double getY()
Specified by:
getY in interface com.graphbuilder.geom.Point2d

getZ

public double getZ()
Specified by:
getZ in interface com.graphbuilder.geom.Point3d

setLocation

public void setLocation(double x,
                        double y)
Specified by:
setLocation in interface com.graphbuilder.geom.Point2d

distance

public double distance(CAPIPoint3D two)
computes the Euclidean distance between the current point $\mathbf{x_1} = (x_1, y_1, z_1)$ the the point "two" $\mathbf{x_2} = (x_2, y_2, z_2)$ as
$|| \mathbf{x_1} - \mathbf{x_2} ||  = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2 + (z_1 - z_2)^2}$.

Parameters:
two - the other point
Returns:
the distance

setLocation

public void setLocation(double[] p)
Specified by:
setLocation in interface com.graphbuilder.curve.CurvePoint

getLocationAsDoubleArray

public double[] getLocationAsDoubleArray()
Specified by:
getLocationAsDoubleArray in interface com.graphbuilder.curve.CurvePoint

setLocation

public void setLocation(double x,
                        double y,
                        double z)
Specified by:
setLocation in interface com.graphbuilder.geom.Point3d

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object