Top Description Fields Constructors Methods
org.apache.commons.math3.geometry.spherical.oned

public Class S1Point

extends Object
implements Point<Sphere1D>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.geometry.Point, java.io.Serializable
Imports
org.apache.commons.math3.geometry.Point, .Space, org.apache.commons.math3.geometry.euclidean.twod.Vector2D, org.apache.commons.math3.util.FastMath, .MathUtils

This class represents a point on the 1-sphere.

Instances of this class are guaranteed to be immutable.

Since
3.3

Field Summary

Modifier and TypeField and Description
private final double
alpha

Azimuthal angle \( \alpha \).

public static final S1Point
NaN

A vector with all coordinates set to NaN.

private static final long
serialVersionUID

Serializable UID.

private final Vector2D
vector

Corresponding 2D normalized vector.

Constructor Summary

AccessConstructor and Description
public
S1Point(final double
azimuthal angle \( \alpha \)
alpha
)

Simple constructor.

private
S1Point(final double
azimuthal angle \( \alpha \)
alpha
,
final Vector2D
corresponding vector
vector
)

Build a point from its internal components.

Method Summary

Modifier and TypeMethod and Description
public double
distance(final Point<Sphere1D>
second point
point
)

Implements org.apache.commons.math3.geometry.Point.distance.

Compute the distance between the instance and another point.

public static double

Returns:

the angular separation between p1 and p2
distance
(S1Point
first vector
p1
,
S1Point
second vector
p2
)

Compute the distance (angular separation) between two points.

public boolean

Returns:

true if two points on the 2-sphere objects are equal, false if object is null, not an instance of S2Point, or not equal to this S2Point instance
equals
(Object
Object to test for equality to this
other
)

Overrides java.lang.Object.equals.

Test for the equality of two points on the 2-sphere.

public double

Returns:

azimuthal angle \( \alpha \)
getAlpha
()

Get the azimuthal angle \( \alpha \).

public Space
getSpace()

Implements org.apache.commons.math3.geometry.Point.getSpace.

Get the space to which the point belongs.

public Vector2D

Returns:

normalized vector
getVector
()

Get the corresponding normalized vector in the 2D euclidean space.

public int

Returns:

a hash code value for this object
hashCode
()

Overrides java.lang.Object.hashCode.

Get a hashCode for the 2D vector.

public boolean
isNaN()

Implements org.apache.commons.math3.geometry.Point.isNaN.

Returns true if any coordinate of this point is NaN; false otherwise

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

alphaback to summary
private final double alpha

Azimuthal angle \( \alpha \).

NaNback to summary
public static final S1Point NaN

A vector with all coordinates set to NaN.

serialVersionUIDback to summary
private static final long serialVersionUID

Serializable UID.

vectorback to summary
private final Vector2D vector

Corresponding 2D normalized vector.

Constructor Detail

S1Pointback to summary
public S1Point(final double alpha)

Simple constructor. Build a vector from its coordinates

Parameters
alpha:double

azimuthal angle \( \alpha \)

See Also
getAlpha()
S1Pointback to summary
private S1Point(final double alpha, final Vector2D vector)

Build a point from its internal components.

Parameters
alpha:double

azimuthal angle \( \alpha \)

vector:Vector2D

corresponding vector

Method Detail

distanceback to summary
public double distance(final Point<Sphere1D> point)

Implements org.apache.commons.math3.geometry.Point.distance.

Doc from org.apache.commons.math3.geometry.Point.distance.

Compute the distance between the instance and another point.

Parameters
point:Point<Sphere1D>

second point

Returns:double

the distance between the instance and p

distanceback to summary
public static double distance(S1Point p1, S1Point p2)

Compute the distance (angular separation) between two points.

Parameters
p1:S1Point

first vector

p2:S1Point

second vector

Returns:double

the angular separation between p1 and p2

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Test for the equality of two points on the 2-sphere.

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 vector and be equals to each other - i.e, if either (or all) coordinates of the 2D vector are equal to Double.NaN, the 2D vector is equal to NaN.

Parameters
other:Object

Object to test for equality to this

Returns:boolean

true if two points on the 2-sphere objects are equal, false if object is null, not an instance of S2Point, or not equal to this S2Point instance

Annotations
@Override
getAlphaback to summary
public double getAlpha()

Get the azimuthal angle \( \alpha \).

Returns:double

azimuthal angle \( \alpha \)

See Also
S1Point(double)
getSpaceback to summary
public Space getSpace()

Implements org.apache.commons.math3.geometry.Point.getSpace.

Doc from org.apache.commons.math3.geometry.Point.getSpace.

Get the space to which the point belongs.

Returns:Space

containing space

getVectorback to summary
public Vector2D getVector()

Get the corresponding normalized vector in the 2D euclidean space.

Returns:Vector2D

normalized vector

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Get a hashCode for the 2D vector.

All NaN values have the same hash code.

Returns:int

a hash code value for this object

Annotations
@Override
isNaNback to summary
public boolean isNaN()

Implements org.apache.commons.math3.geometry.Point.isNaN.

Doc from org.apache.commons.math3.geometry.Point.isNaN.

Returns true if any coordinate of this point is NaN; false otherwise

Returns:boolean

true if any coordinate of this point is NaN; false otherwise