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

java.lang.Object
  extended by edu.stanford.rsl.konrad.geometry.shapes.simple.PointND
      extended by edu.stanford.rsl.konrad.geometry.splines.capi.CAPIPoint
          extended by edu.stanford.rsl.konrad.geometry.splines.capi.CAPIPoint2D
All Implemented Interfaces:
com.graphbuilder.curve.CurvePoint, com.graphbuilder.geom.Point2d, Transformable, java.io.Serializable

public class CAPIPoint2D
extends CAPIPoint
implements com.graphbuilder.geom.Point2d

A class to model a 2D point. Compatible with java.awt and com.graphbuilder

Author:
akmaier
See Also:
Serialized Form

Constructor Summary
CAPIPoint2D(double x, double y)
           
 
Method Summary
 double distance(CAPIPoint2D two)
          computes the Euclidean distance between the current point $\mathbf{x_1} = (x_1, y_1)$ the the point "two" $\mathbf{x_2} = (x_2, y_2)$ as $|| \\mathbf{x_1} - \\mathbf{x_2} || = \\sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}$.
 double getX()
           
 double getY()
           
 void setLocation(double[] p)
           
 void setLocation(double x, double y)
           
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.splines.capi.CAPIPoint
getLocationAsDoubleArray
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.shapes.simple.PointND
applyTransform, clone, equals, euclideanDistance, get, getAbstractVector, getCoordinates, getDimension, set, setCoordinates, toString, updateIfHigher, updateIfLower
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CAPIPoint2D

public CAPIPoint2D(double x,
                   double y)
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

setLocation

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

distance

public double distance(CAPIPoint2D two)
computes the Euclidean distance between the current point $\mathbf{x_1} = (x_1, y_1)$ the the point "two" $\mathbf{x_2} = (x_2, y_2)$ as
$|| \mathbf{x_1} - \mathbf{x_2} ||  = \sqrt{(x_1 - x_2)^2 + (y_1 - y_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
Overrides:
setLocation in class CAPIPoint