public final class BoundingSphere extends Object implements IEquatable<BoundingSphere>, IEquatableEpsilon<BoundingSphere>, ImmutableValueType
Constructor and Description |
---|
BoundingSphere()
Initializes a new instance.
|
BoundingSphere(Cartesian center,
double radius)
Initializes a
BoundingSphere from a center (Cartesian) and a radius (double). |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(BoundingSphere left,
BoundingSphere 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(BoundingSphere other,
double epsilon)
Indicates whether the center and radius of another instance of this type
is within the required tolerance of the corresponding center and radius value of this instance.
|
boolean |
equalsType(BoundingSphere other)
Indicates whether another instance of this type is exactly equal to this instance.
|
Cartesian |
getCenter()
Gets the Cartesian center of the bounding sphere.
|
static BoundingSphere |
getMaximumRadiusBoundingSphere()
Gets the bounding sphere of maximum possible radius.
|
double |
getRadius()
Gets the radius of the bounding sphere.
|
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(BoundingSphere left,
BoundingSphere right)
Returns
true if the two instances are not exactly equal. |
String |
toString()
Returns the string representation of the value of this instance.
|
public BoundingSphere()
public BoundingSphere(@Nonnull Cartesian center, double radius)
BoundingSphere
from a center (Cartesian) and a radius (double).center
- The center of the bounding sphere.radius
- The radius of the bounding sphere.@Nonnull public final Cartesian getCenter()
public final double getRadius()
@Nonnull public static BoundingSphere getMaximumRadiusBoundingSphere()
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 BoundingSphere other)
equalsType
in interface IEquatable<BoundingSphere>
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 BoundingSphere other, double epsilon)
equalsEpsilon
in interface IEquatableEpsilon<BoundingSphere>
other
- The set of BoundingSphere
parameters (center and radius) to compare to this instance.epsilon
- The limit at which the absolute differences between the 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 BoundingSphere left, @Nonnull BoundingSphere 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 BoundingSphere left, @Nonnull BoundingSphere 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
.