Constructor and Description |
---|
Point_2() |
Point_2(java.lang.Number x,
java.lang.Number y) |
Point_2(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)
Compare two points (lexicographic order on coordinates)
|
int |
dimension()
Return the dimension of the space
|
java.lang.Number |
distanceFrom(Point_2 p) |
boolean |
equals(java.lang.Object o) |
java.lang.Number |
getCartesian(int i)
return the i-th cartesian coordinate of the point
|
java.lang.Number |
getX() |
java.lang.Number |
getY() |
int |
hashCode() |
void |
linearCombination(Point_[] points,
java.lang.Number[] coefficients)
Set the current point a linear combination of an array of points.
|
static Point_2 |
linearCombination(Point_2[] points,
java.lang.Number[] coefficients) |
static Point_2 |
midPoint(Point_2 p,
Point_2 q) |
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
|
void |
setX(java.lang.Double x) |
void |
setY(java.lang.Double y) |
java.lang.Number |
squareDistance(Point_ p)
Return the square distance ||p-q||^2, where q is the current point
|
Point_2 |
sum(Vector_ v) |
java.lang.String |
toString()
Return a string (representation of the point)
|
void |
translateOf(Vector_ v)
Translate the current point according to a vector v
|
public Point_2()
public Point_2(java.lang.Number x, java.lang.Number y)
public Point_2(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 static Point_2 linearCombination(Point_2[] points, java.lang.Number[] coefficients)
public java.lang.Number getX()
public java.lang.Number getY()
public void setX(java.lang.Double x)
public void setY(java.lang.Double y)
public void translateOf(Vector_ v)
Point_
translateOf
in interface Point_
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Number distanceFrom(Point_2 p)
public java.lang.Number squareDistance(Point_ p)
Point_
squareDistance
in interface Point_
public 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 int compareTo(Point_ o)
compareTo
in interface java.lang.Comparable<Point_>
o
- the point to comparepublic int compareCartesian(Point_ o, int i)
compareCartesian
in interface Point_
o
- the point to comparei
- the i-th coordinate to compare