public final class Pyramidal extends Object implements IEquatable<Pyramidal>, IEquatableEpsilon<Pyramidal>, ImmutableValueType
Constructor and Description |
---|
Pyramidal()
Initializes a new instance.
|
Pyramidal(Cartesian coordinates)
|
Pyramidal(double[] elements)
Initializes a set of
Pyramidal coordinates from the first 3 consecutive elements in the provided array. |
Pyramidal(double[] elements,
int startIndex)
Initializes a set of
Pyramidal coordinates from 3 consecutive elements in the provided array. |
Pyramidal(double zxAngle,
double zyAngle,
double z)
Initializes a set of
Pyramidal coordinates from the provided values. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
static boolean |
equals(Pyramidal left,
Pyramidal right)
Returns
true if the two instances are exactly equal. |
boolean |
equalsEpsilon(Pyramidal 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(Pyramidal other)
Indicates whether another instance of this type is exactly equal to this instance.
|
double |
get(int index)
|
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.
|
static Pyramidal |
getUndefined()
Gets a set of
Pyramidal coordinates with values of Double.NaN . |
double |
getZ()
Gets the linear coordinate along the positive z-axis.
|
static Pyramidal |
getZero()
Gets a set of
Pyramidal coordinates with values of zero. |
double |
getZXAngle()
Gets the angular coordinate that is z-x.
|
double |
getZYAngle()
Gets the angular coordinate that is z-y.
|
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(Pyramidal left,
Pyramidal right)
Returns
true if the two instances are not exactly equal. |
String |
toString()
Returns the string representation of the value of this instance.
|
public Pyramidal()
public Pyramidal(double zxAngle, double zyAngle, double z)
Pyramidal
coordinates from the provided values.zxAngle
- The angular coordinate in z-x.zyAngle
- The angular coordinate in z-y.z
- The linear coordinate along the positive z-axis.public Pyramidal(@Nonnull Cartesian coordinates)
coordinates
- The set of Cartesian
coordinates.public Pyramidal(@Nonnull double[] elements)
Pyramidal
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 Pyramidal(@Nonnull double[] elements, int startIndex)
Pyramidal
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 the array of elements
is null
.ArgumentOutOfRangeException
- Thrown when an object of this type is constructed from an array with less than 3 elements
.@Nonnull public static Pyramidal getZero()
Pyramidal
coordinates with values of zero.@Nonnull public static Pyramidal getUndefined()
Pyramidal
coordinates with values of Double.NaN
.
Use IsUndefined
(get
) to test whether a Pyramidal
instance
is undefined since it will return true
if any of the coordinate values
are Double.NaN
.
public final double getZXAngle()
public final double getZYAngle()
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
ZXAngle
(get
), ZYAngle
(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 Pyramidal other)
equalsType
in interface IEquatable<Pyramidal>
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 Pyramidal other, double epsilon)
equalsEpsilon
in interface IEquatableEpsilon<Pyramidal>
other
- The set of Pyramidal
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 Pyramidal left, @Nonnull Pyramidal 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 Pyramidal left, @Nonnull Pyramidal 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
.