public interface Vector2dc
| Modifier and Type | Method and Description |
|---|---|
Vector2d |
add(double x,
double y,
Vector2d dest)
Add
(x, y) to this vector and store the result in dest. |
Vector2d |
add(Vector2dc v,
Vector2d dest)
Add
v to this vector and store the result in dest. |
Vector2d |
add(Vector2fc v,
Vector2d dest)
Add
v to this vector and store the result in dest. |
double |
angle(Vector2dc v)
Return the angle between this vector and the supplied vector.
|
Vector2d |
ceil(Vector2d dest)
Compute for each component of this vector the smallest (closest to negative
infinity)
double value that is greater than or equal to that
component and is equal to a mathematical integer and store the result in
dest. |
double |
distance(double x,
double y)
Return the distance between
this vector and (x, y). |
double |
distance(Vector2dc v)
Return the distance between this and
v. |
double |
distance(Vector2fc v)
Return the distance between this and
v. |
double |
distanceSquared(double x,
double y)
Return the distance squared between
this vector and (x, y). |
double |
distanceSquared(Vector2dc v)
Return the distance squared between this and
v. |
double |
distanceSquared(Vector2fc v)
Return the distance squared between this and
v. |
double |
dot(Vector2dc v)
Return the dot product of this vector and
v. |
boolean |
equals(double x,
double y)
Compare the vector components of
this vector with the given (x, y)
and return whether all of them are equal. |
boolean |
equals(Vector2dc v,
double delta)
Compare the vector components of
this vector with the given vector using the given delta
and return whether all of them are equal within a maximum difference of delta. |
Vector2d |
floor(Vector2d dest)
Compute for each component of this vector the largest (closest to positive
infinity)
double value that is less than or equal to that
component and is equal to a mathematical integer and store the result in
dest. |
Vector2d |
fma(double a,
Vector2dc b,
Vector2d dest)
Add the component-wise multiplication of
a * b to this vector
and store the result in dest. |
Vector2d |
fma(Vector2dc a,
Vector2dc b,
Vector2d dest)
Add the component-wise multiplication of
a * b to this vector
and store the result in dest. |
ByteBuffer |
get(ByteBuffer buffer)
Store this vector into the supplied
ByteBuffer at the current
buffer position. |
DoubleBuffer |
get(DoubleBuffer buffer)
Store this vector into the supplied
DoubleBuffer at the current
buffer position. |
double |
get(int component)
Get the value of the specified component of this vector.
|
ByteBuffer |
get(int index,
ByteBuffer buffer)
Store this vector into the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
DoubleBuffer |
get(int index,
DoubleBuffer buffer)
Store this vector into the supplied
DoubleBuffer starting at the specified
absolute buffer position/index. |
boolean |
isFinite()
|
double |
length()
Return the length of this vector.
|
double |
lengthSquared()
Return the length squared of this vector.
|
Vector2d |
lerp(Vector2dc other,
double t,
Vector2d dest)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in dest. |
Vector2d |
max(Vector2dc v,
Vector2d dest)
Set the components of
dest to be the component-wise maximum of this and the other vector. |
int |
maxComponent()
Determine the component with the biggest absolute value.
|
Vector2d |
min(Vector2dc v,
Vector2d dest)
Set the components of
dest to be the component-wise minimum of this and the other vector. |
int |
minComponent()
Determine the component with the smallest (towards zero) absolute value.
|
Vector2d |
mul(double x,
double y,
Vector2d dest)
Multiply the components of this Vector2d by the given scalar values and store the result in
dest. |
Vector2d |
mul(double scalar,
Vector2d dest)
Multiply the components of this vector by the given scalar and store the result in
dest. |
Vector2d |
mul(Matrix2dc mat,
Vector2d dest)
Multiply the given matrix
mat with this and store the
result in dest. |
Vector2d |
mul(Matrix2fc mat,
Vector2d dest)
Multiply the given matrix
mat with this and store the
result in dest. |
Vector2d |
mul(Vector2dc v,
Vector2d dest)
Multiply this Vector2d component-wise by another Vector2d and store the result in
dest. |
Vector2d |
mulDirection(Matrix3x2dc mat,
Vector2d dest)
Multiply the given 3x2 matrix
mat with this and store the
result in dest. |
Vector2d |
mulPosition(Matrix3x2dc mat,
Vector2d dest)
Multiply the given 3x2 matrix
mat with this and store the
result in dest. |
Vector2d |
mulTranspose(Matrix2dc mat,
Vector2d dest)
Multiply the transpose of the given matrix with this Vector2f and store the result in
dest. |
Vector2d |
mulTranspose(Matrix2fc mat,
Vector2d dest)
Multiply the transpose of the given matrix with this Vector2f and store the result in
dest. |
Vector2d |
negate(Vector2d dest)
Negate this vector and store the result in
dest. |
Vector2d |
normalize(double length,
Vector2d dest)
Scale this vector to have the given length and store the result in
dest. |
Vector2d |
normalize(Vector2d dest)
Normalize this vector and store the result in
dest. |
Vector2d |
round(Vector2d dest)
Compute for each component of this vector the closest double that is equal to
a mathematical integer, with ties rounding to positive infinity and store
the result in
dest. |
Vector2d |
sub(double x,
double y,
Vector2d dest)
Subtract
(x, y) from this vector and store the result in dest. |
Vector2d |
sub(Vector2dc v,
Vector2d dest)
Subtract
v from this vector and store the result in dest. |
Vector2d |
sub(Vector2fc v,
Vector2d dest)
Subtract
v from this vector and store the result in dest. |
double |
x() |
double |
y() |
double x()
double y()
ByteBuffer get(ByteBuffer buffer)
ByteBuffer at the current
buffer position.
This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which
the vector is stored, use get(int, ByteBuffer), taking
the absolute position as parameter.
buffer - will receive the values of this vector in x, y orderget(int, ByteBuffer)ByteBuffer get(int index, ByteBuffer buffer)
ByteBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
index - the absolute position into the ByteBufferbuffer - will receive the values of this vector in x, y orderDoubleBuffer get(DoubleBuffer buffer)
DoubleBuffer at the current
buffer position.
This method will not increment the position of the given DoubleBuffer.
In order to specify the offset into the DoubleBuffer at which
the vector is stored, use get(int, DoubleBuffer), taking
the absolute position as parameter.
buffer - will receive the values of this vector in x, y orderget(int, DoubleBuffer)DoubleBuffer get(int index, DoubleBuffer buffer)
DoubleBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given DoubleBuffer.
index - the absolute position into the DoubleBufferbuffer - will receive the values of this vector in x, y orderVector2d sub(double x, double y, Vector2d dest)
(x, y) from this vector and store the result in dest.x - the x component to subtracty - the y component to subtractdest - will hold the resultVector2d sub(Vector2dc v, Vector2d dest)
v from this vector and store the result in dest.v - the vector to subtractdest - will hold the resultVector2d sub(Vector2fc v, Vector2d dest)
v from this vector and store the result in dest.v - the vector to subtractdest - will hold the resultVector2d mul(double scalar, Vector2d dest)
dest.scalar - the value to multiply this vector's components bydest - will hold the resultVector2d mul(double x, double y, Vector2d dest)
dest.x - the x component to multiply this vector byy - the y component to multiply this vector bydest - will hold the resultVector2d mul(Vector2dc v, Vector2d dest)
dest.v - the vector to multiply bydest - will hold the resultVector2d mul(Matrix2dc mat, Vector2d dest)
mat with this and store the
result in dest.mat - the matrix to multiply this vector bydest - will hold the resultVector2d mul(Matrix2fc mat, Vector2d dest)
mat with this and store the
result in dest.mat - the matrix to multiply this vector bydest - will hold the resultVector2d mulTranspose(Matrix2dc mat, Vector2d dest)
dest.mat - the matrixdest - will hold the resultVector2d mulTranspose(Matrix2fc mat, Vector2d dest)
dest.mat - the matrixdest - will hold the resultVector2d mulPosition(Matrix3x2dc mat, Vector2d dest)
mat with this and store the
result in dest.
This method assumes the z component of this to be 1.0.
mat - the matrix to multiply this vector bydest - will hold the resultVector2d mulDirection(Matrix3x2dc mat, Vector2d dest)
mat with this and store the
result in dest.
This method assumes the z component of this to be 0.0.
mat - the matrix to multiply this vector bydest - will hold the resultdouble dot(Vector2dc v)
v.v - the other vectordouble angle(Vector2dc v)
v - the other vectordouble lengthSquared()
double length()
double distance(Vector2dc v)
v.v - the other vectordouble distanceSquared(Vector2dc v)
v.v - the other vectordouble distance(Vector2fc v)
v.v - the other vectordouble distanceSquared(Vector2fc v)
v.v - the other vectordouble distance(double x,
double y)
this vector and (x, y).x - the x component of the other vectory - the y component of the other vectordouble distanceSquared(double x,
double y)
this vector and (x, y).x - the x component of the other vectory - the y component of the other vectorVector2d normalize(Vector2d dest)
dest.dest - will hold the resultVector2d normalize(double length, Vector2d dest)
dest.length - the desired lengthdest - will hold the resultVector2d add(double x, double y, Vector2d dest)
(x, y) to this vector and store the result in dest.x - the x component to addy - the y component to adddest - will hold the resultVector2d add(Vector2dc v, Vector2d dest)
v to this vector and store the result in dest.v - the vector to adddest - will hold the resultVector2d add(Vector2fc v, Vector2d dest)
v to this vector and store the result in dest.v - the vector to adddest - will hold the resultVector2d negate(Vector2d dest)
dest.dest - will hold the resultVector2d lerp(Vector2dc other, double t, Vector2d dest)
this and other using the given interpolation factor t
and store the result in dest.
If t is 0.0 then the result is this. If the interpolation factor is 1.0
then the result is other.
other - the other vectort - the interpolation factor between 0.0 and 1.0dest - will hold the resultVector2d fma(Vector2dc a, Vector2dc b, Vector2d dest)
a * b to this vector
and store the result in dest.a - the first multiplicandb - the second multiplicanddest - will hold the resultVector2d fma(double a, Vector2dc b, Vector2d dest)
a * b to this vector
and store the result in dest.a - the first multiplicandb - the second multiplicanddest - will hold the resultVector2d min(Vector2dc v, Vector2d dest)
dest to be the component-wise minimum of this and the other vector.v - the other vectordest - will hold the resultVector2d max(Vector2dc v, Vector2d dest)
dest to be the component-wise maximum of this and the other vector.v - the other vectordest - will hold the resultint maxComponent()
[0..1]int minComponent()
[0..1]double get(int component)
throws IllegalArgumentException
component - the component, within [0..1]IllegalArgumentException - if component is not within [0..1]Vector2d floor(Vector2d dest)
double value that is less than or equal to that
component and is equal to a mathematical integer and store the result in
dest.dest - will hold the resultVector2d ceil(Vector2d dest)
double value that is greater than or equal to that
component and is equal to a mathematical integer and store the result in
dest.dest - will hold the resultVector2d round(Vector2d dest)
dest.dest - will hold the resultboolean isFinite()
NaN and not
infinity.true if all components are finite floating-point values;
false otherwiseboolean equals(Vector2dc v, double delta)
this vector with the given vector using the given delta
and return whether all of them are equal within a maximum difference of delta.
Please note that this method is not used by any data structure such as ArrayList HashSet or HashMap
and their operations, such as ArrayList.contains(Object) or HashSet.remove(Object), since those
data structures only use the Object.equals(Object) and Object.hashCode() methods.
v - the other vectordelta - the allowed maximum differencetrue whether all of the vector components are equal; false otherwiseboolean equals(double x,
double y)
this vector with the given (x, y)
and return whether all of them are equal.x - the x component to compare toy - the y component to compare totrue if all the vector components are equalCopyright © 2015–2019 JOML. All rights reserved.