public class S1Point extends Object implements Point<Sphere1D>
Instances of this class are guaranteed to be immutable.
| Modifier and Type | Field and Description |
|---|---|
static S1Point |
NaN
A vector with all coordinates set to NaN.
|
| Constructor and Description |
|---|
S1Point(double alpha)
Simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distance(Point<Sphere1D> point)
Compute the distance between the instance and another point.
|
static double |
distance(S1Point p1,
S1Point p2)
Compute the distance (angular separation) between two points.
|
boolean |
equals(Object other)
Test for the equality of two points on the 1-sphere.
|
boolean |
equalsIeee754(Object other)
Test for the equality of two points on the 1-sphere.
|
double |
getAlpha()
Get the azimuthal angle \( \alpha \).
|
Space |
getSpace()
Get the space to which the point belongs.
|
Vector2D |
getVector()
Get the corresponding normalized vector in the 2D euclidean space.
|
int |
hashCode()
Get a hashCode for the point.
|
boolean |
isNaN()
Returns true if any coordinate of this point is NaN; false otherwise
|
public static final S1Point NaN
public S1Point(double alpha)
alpha - azimuthal angle \( \alpha \)getAlpha()public double getAlpha()
S1Point(double)public Vector2D getVector()
public Space getSpace()
public boolean isNaN()
public double distance(Point<Sphere1D> point)
public static double distance(S1Point p1, S1Point p2)
p1 - first vectorp2 - second vectorpublic boolean equals(Object other)
If all coordinates of two points are exactly the same, and none are
Double.NaN, the two points are considered to be equal.
NaN coordinates are considered to affect globally the point
and be equals to each other - i.e, if either (or all) coordinates of the
point are equal to Double.NaN, the point is equal to
NaN.
public boolean equalsIeee754(Object other)
If all coordinates of two points are exactly the same, and none are
Double.NaN, the two points are considered to be equal.
In compliance with IEEE754 handling, if any coordinates of any of the
two points are NaN, then the points are considered different.
This implies that S1Point.NaN.equals(S1Point.NaN)
returns false despite the instance is checked against itself.
other - Object to test for equality to thisCopyright © 2016-2022 CS GROUP. All rights reserved.