|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.rsl.konrad.geometry.shapes.simple.PointND
public class PointND
Class to model points of arbitrary dimension. Compatible with numerics.
Constructor Summary | |
---|---|
PointND(double... point)
Creates a new point of a given array or list of double values. |
|
PointND(PointND point)
Copy constructor |
|
PointND(SimpleVector knotVector)
Creates a new point of the specified dimension |
Method Summary | |
---|---|
void |
applyTransform(Transform t)
Applies the Transform t to the object. |
PointND |
clone()
|
boolean |
equals(java.lang.Object o)
|
double |
euclideanDistance(PointND two)
computes the Euclidean distance between the current point ![]() ![]() |
double |
get(int i)
Method to retrieve coordinate entries |
SimpleVector |
getAbstractVector()
Returns the internal abstract vector to enable computations via the numerics library. Changes to the vector will affect the point |
double[] |
getCoordinates()
Returns a copy of the point as double array. |
int |
getDimension()
Returns the dimension of the point |
void |
set(int i,
double d)
Methods to set individual entries of the coordinates |
void |
setCoordinates(SimpleVector coordinates)
|
java.lang.String |
toString()
|
void |
updateIfHigher(PointND p)
Updates the vector at entries which are higher in p. |
void |
updateIfLower(PointND p)
Updates the vector at entries which are higher in p. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PointND(SimpleVector knotVector)
knotVector
- the dimensionpublic PointND(PointND point)
point
- public PointND(double... point)
PointND p = new PointND(1.5, 2.5); ArbitrayrPoint p2 = new PointND(new double [] {1.5, 2.5});will create two 2D points at the same location.
point
- Method Detail |
---|
public void setCoordinates(SimpleVector coordinates)
coordinates
- the coordinates to setpublic PointND clone()
clone
in class java.lang.Object
public double[] getCoordinates()
public double get(int i)
i
- the index of the coordinate [0, dim[
public void set(int i, double d)
i
- the index of the coordinate [0, dim[d
- the value of the coordinatepublic SimpleVector getAbstractVector()
public int getDimension()
public double euclideanDistance(PointND two)
two
- the other point
public java.lang.String toString()
toString
in class java.lang.Object
public void updateIfHigher(PointND p)
ArrayListlist = ... PointND max = new PointND(-Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE); for (PointND p : list){ max.updateIfHigher(p); }
- Parameters:
p
- the other point
public void updateIfLower(PointND p)
ArrayListlist = ... PointND min = new PointND(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE); for (PointND p : list){ min.updateIfLower(p); }
- Parameters:
p
- the other point
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void applyTransform(Transform t)
Transformable
applyTransform
in interface Transformable
t
- the transform to apply to the object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |