public final class Cylindrical extends Object implements IEquatable<Cylindrical>, IEquatableEpsilon<Cylindrical>, ImmutableValueType
The corresponding 2-dimensional coordinates are Polar
coordinates.
Constructor and Description |
---|
Cylindrical()
Initializes a new instance.
|
Cylindrical(AzimuthElevationRange coordinates)
Initializes a set of
Cylindrical coordinates from the provided set of
AzimuthElevationRange coordinates. |
Cylindrical(Cartesian coordinates)
Initializes a set of
Cylindrical coordinates from the provided set of Cartesian coordinates. |
Cylindrical(double[] elements)
Initializes a set of
Cylindrical coordinates from the first 3 consecutive elements in the provided array. |
Cylindrical(double[] elements,
int startIndex)
Initializes a set of
Cylindrical coordinates from 3 consecutive elements in the provided array. |
Cylindrical(double clock,
double radial,
double z)
Initializes a set of
Cylindrical coordinates from the provided values. |
Cylindrical(LongitudeLatitudeRadius coordinates)
Initializes a set of
Cylindrical coordinates from the provided set of LongitudeLatitudeRadius coordinates. |
Cylindrical(Spherical coordinates)
Initializes a set of
Cylindrical coordinates from the provided set of Spherical coordinates. |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(Cylindrical left,
Cylindrical right)
Returns
true if the two instances are exactly equal. |
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
boolean |
equalsEpsilon(Cylindrical other,
double epsilon)
Indicates whether each coordinate value of another instance of this type
is within the required tolerance of the corresponding coordinate value of this instance.
|
boolean |
equalsType(Cylindrical other)
Indicates whether another instance of this type is exactly equal to this instance.
|
double |
get(int index)
|
double |
getClock()
Gets the angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
|
boolean |
getIsUndefined()
Gets a value indicating whether any of the coordinates for this instance have the value
Double.NaN . |
int |
getLength()
Gets the number of elements in this set of coordinates.
|
double |
getRadial()
Gets the linear coordinate perpendicular to the z-axis.
|
static Cylindrical |
getUndefined()
Gets a set of
Cylindrical coordinates with values of Double.NaN . |
double |
getZ()
Gets the linear coordinate along the positive z-axis.
|
static Cylindrical |
getZero()
Gets a set of
Cylindrical coordinates with values of zero. |
int |
hashCode()
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
|
static boolean |
notEquals(Cylindrical left,
Cylindrical right)
Returns
true if the two instances are not exactly equal. |
String |
toString()
Returns the string representation of the value of this instance.
|
public Cylindrical()
public Cylindrical(double clock, double radial, double z)
Cylindrical
coordinates from the provided values.clock
- The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.radial
- The linear coordinate perpendicular to the z-axis.z
- The linear coordinate along the positive z-axis.public Cylindrical(@Nonnull Spherical coordinates)
Cylindrical
coordinates from the provided set of Spherical
coordinates.coordinates
- The set of Spherical
coordinates.public Cylindrical(@Nonnull LongitudeLatitudeRadius coordinates)
Cylindrical
coordinates from the provided set of LongitudeLatitudeRadius
coordinates.coordinates
- The set of LongitudeLatitudeRadius
coordinates.public Cylindrical(@Nonnull Cartesian coordinates)
Cylindrical
coordinates from the provided set of Cartesian
coordinates.coordinates
- The set of Cartesian
coordinates.public Cylindrical(@Nonnull AzimuthElevationRange coordinates)
Cylindrical
coordinates from the provided set of
AzimuthElevationRange
coordinates.coordinates
- The set of AzimuthElevationRange
coordinates.public Cylindrical(@Nonnull double[] elements)
Cylindrical
coordinates from the first 3 consecutive elements in the provided array.elements
- The array of coordinate values.ArgumentNullException
- Thrown when elements
is null
.ArgumentOutOfRangeException
- An object of this type must be constructed from an array with at least 3 elements
.public Cylindrical(@Nonnull double[] elements, int startIndex)
Cylindrical
coordinates from 3 consecutive elements in the provided array.elements
- The array of coordinate values.startIndex
- The index of the first element in the array to use.ArgumentNullException
- Thrown when elements
is null
.ArgumentOutOfRangeException
- Thrown when an object of this type is constructed from an array with less than 3 elements
.@Nonnull public static Cylindrical getZero()
Cylindrical
coordinates with values of zero.@Nonnull public static Cylindrical getUndefined()
Cylindrical
coordinates with values of Double.NaN
.
Use IsUndefined
(get
) to test whether a Cylindrical
instance
is undefined since it will return true
if any of the coordinate values
are Double.NaN
.
public final double getClock()
public final double getRadial()
public final double getZ()
public final boolean getIsUndefined()
Double.NaN
.public final int getLength()
public final double get(int index)
index
of 0, 1, and 2 corresponding to the coordinates
Clock
(get
), Radial
(get
), and Z
(get
).index
- The index to retrieve.index
.ArgumentOutOfRangeException
- Thrown when index
is less than 0 or greater than or equal to Length
(get
).public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare to this instance.true
if obj
is an instance of this type and represents the same value as this instance; otherwise false
.Object.hashCode()
,
HashMap
public final boolean equalsType(@Nonnull Cylindrical other)
equalsType
in interface IEquatable<Cylindrical>
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.public final boolean equalsEpsilon(@Nonnull Cylindrical other, double epsilon)
equalsEpsilon
in interface IEquatableEpsilon<Cylindrical>
other
- The set of Cylindrical
coordinates to compare to this instance.epsilon
- The limit at which the absolute differences between the coordinate values will not be considered equal.true
if the absolute differences are less than or equal to epsilon
; otherwise false
.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString()
public static boolean equals(@Nonnull Cylindrical left, @Nonnull Cylindrical right)
true
if the two instances are exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
represents the same value as right
; otherwise false
.public static boolean notEquals(@Nonnull Cylindrical left, @Nonnull Cylindrical right)
true
if the two instances are not exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
does not represent the same value as right
; otherwise false
.