D - the dimension of the vectorpublic final class Vec<D extends OneMin> extends GeometrixObject
VecHelper| Modifier and Type | Method and Description |
|---|---|
static <D extends OneMin> |
create(D dim,
double... values)
Constructs a new
Vec using an array of double values. |
static <D extends OneMin> |
createOptional(D dim,
double... values)
Constructs a new
Vec using an array of double values. |
boolean |
equals(java.lang.Object o) |
static Vec<Four> |
four(double x,
double y,
double z,
double w) |
D |
getDimension() |
double |
getElement(int index)
Gets the element of this vector at a specified location.
|
int |
hashCode() |
static boolean |
isInObjectSpace(Vec<?> v)
Checks if a vector lies inside of the object space.
|
static boolean |
isZeroVec(Vec<?> v)
Checks if a vector is a zero vector.
|
static Vec<One> |
one(double x) |
boolean |
resembles(java.lang.Object o) |
static Vec<Three> |
three(double x,
double y,
double z) |
java.lang.String |
toString() |
static Vec<Two> |
two(double x,
double y) |
static <D extends OneMin> |
zero(D dim) |
public static <D extends OneMin> Vec<D> create(D dim, double... values)
Vec using an array of double values.values - the components of the vectorjava.lang.IllegalArgumentException - if the specified dimension and the amount of values doesn't matchjava.lang.IllegalArgumentException - if an element is equal to (+/-)Infinity or NaNjava.lang.IllegalArgumentException - if the vector lies outside of the vector spacepublic static <D extends OneMin> java.util.Optional<Vec<D>> createOptional(D dim, double... values)
Vec using an array of double values.values - the components of the vectorOptional will be returned.java.lang.NullPointerException - if dim is nulljava.lang.IllegalArgumentException - if the specified dimension and the amount of values doesn't matchjava.lang.IllegalArgumentException - if an element is equal to (+/-)Infinity or NaNpublic static boolean isZeroVec(Vec<?> v)
v - the vector which should be checkedjava.lang.NullPointerException - if v is nullpublic static boolean isInObjectSpace(Vec<?> v)
v - the vector which should be checkedjava.lang.NullPointerException - if v is nullpublic double getElement(int index)
index - the index of the componentjava.lang.IllegalArgumentException - if index is out of boundspublic boolean resembles(java.lang.Object o)
resembles in class GeometrixObjectpublic boolean equals(java.lang.Object o)
equals in class GeometrixObjectpublic int hashCode()
hashCode in class GeometrixObjectpublic java.lang.String toString()
toString in class GeometrixObjectpublic D getDimension()