Modifier and Type | Field and Description |
---|---|
java.lang.Double[] |
coordinates |
Constructor and Description |
---|
Point_d(double[] coord) |
Point_d(int d) |
Point_d(Point_ p) |
Modifier and Type | Method and Description |
---|---|
void |
barycenter(Point_[] points)
Set the current point as the barycenter of an array of points
|
int |
compareCartesian(Point_ o,
int i)
Compare the i-th coordinate of two points
|
int |
compareTo(Point_ o) |
int |
dimension()
Return the dimension of the space
|
boolean |
equals(java.lang.Object o)
Check equality between point coordinates
|
java.lang.Number |
getCartesian(int i)
return the i-th cartesian coordinate of the point
|
void |
linearCombination(Point_[] points,
java.lang.Number[] coefficients)
Set the current point a linear combination of an array of points.
|
Vector_ |
minus(Point_ b)
Return the vector (p-q), where q is the current point
|
void |
setCartesian(int i,
java.lang.Number x)
set the i-th cartesian coordinate
|
void |
setOrigin()
set the coordinates of the origin
|
java.lang.Number |
squareDistance(Point_ p)
Return the square distance ||p-q||^2, where q is the current point
|
java.lang.String |
toString()
Return a string (representation of the point)
|
void |
translateOf(Vector_ v)
Translate the current position of vector v
|
public Point_d(int d)
public Point_d(double[] coord)
public Point_d(Point_ p)
public void barycenter(Point_[] points)
Point_
barycenter
in interface Point_
public void linearCombination(Point_[] points, java.lang.Number[] coefficients)
Point_
linearCombination
in interface Point_
public void translateOf(Vector_ v)
translateOf
in interface Point_
v
- the vector describing the translationpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the point to be comparedpublic java.lang.String toString()
Point_
public int dimension()
Point_
public java.lang.Number getCartesian(int i)
Point_
getCartesian
in interface Point_
public void setCartesian(int i, java.lang.Number x)
Point_
setCartesian
in interface Point_
public void setOrigin()
Point_
public Vector_ minus(Point_ b)
Point_
public java.lang.Number squareDistance(Point_ p)
Point_
squareDistance
in interface Point_
public int compareTo(Point_ o)
compareTo
in interface java.lang.Comparable<Point_>
public int compareCartesian(Point_ o, int i)
compareCartesian
in interface Point_
o
- the point to comparei
- the i-th coordinate to compare