public class Vector4d extends Object implements Externalizable, Vector4dc
| Modifier and Type | Field and Description |
|---|---|
double |
w
The w component of the vector.
|
double |
x
The x component of the vector.
|
double |
y
The y component of the vector.
|
double |
z
The z component of the vector.
|
| Constructor and Description |
|---|
Vector4d()
Create a new
Vector4d of (0, 0, 0, 1). |
Vector4d(ByteBuffer buffer)
Create a new
Vector4d and read this vector from the supplied ByteBuffer
at the current buffer position. |
Vector4d(double d)
Create a new
Vector4d and initialize all four components with the given value. |
Vector4d(DoubleBuffer buffer)
Create a new
Vector4d and read this vector from the supplied DoubleBuffer
at the current buffer position. |
Vector4d(double x,
double y,
double z,
double w)
Create a new
Vector4d with the given component values. |
Vector4d(int index,
ByteBuffer buffer)
Create a new
Vector4d and read this vector from the supplied ByteBuffer
starting at the specified absolute buffer position/index. |
Vector4d(int index,
DoubleBuffer buffer)
Create a new
Vector4d and read this vector from the supplied DoubleBuffer
starting at the specified absolute buffer position/index. |
Vector4d(Vector2dc v,
double z,
double w)
|
Vector4d(Vector2fc v,
double z,
double w)
Create a new
Vector4d with the x and y components from the
given v and the z and w components from the given z and w. |
Vector4d(Vector2ic v,
double z,
double w)
|
Vector4d(Vector3dc v,
double w)
|
Vector4d(Vector3fc v,
double w)
Create a new
Vector4d with the x, y, and z components from the
given v and the w component from the given w. |
Vector4d(Vector3ic v,
double w)
|
Vector4d(Vector4dc v)
Create a new
Vector4d with the same values as v. |
Vector4d(Vector4fc v)
Create a new
Vector4d with the same values as v. |
Vector4d(Vector4ic v)
Create a new
Vector4d with the same values as v. |
| Modifier and Type | Method and Description |
|---|---|
Vector4d |
add(double x,
double y,
double z,
double w)
Add
(x, y, z, w) to this. |
Vector4d |
add(double x,
double y,
double z,
double w,
Vector4d dest)
Add
(x, y, z, w) to this and store the result in dest. |
Vector4d |
add(Vector4dc v)
Add the supplied vector to this one.
|
Vector4d |
add(Vector4dc v,
Vector4d dest)
Add the supplied vector to this one and store the result in
dest. |
Vector4d |
add(Vector4fc v)
Add the supplied vector to this one.
|
Vector4d |
add(Vector4fc v,
Vector4d dest)
Add the supplied vector to this one and store the result in
dest. |
double |
angle(Vector4dc v)
Return the angle between this vector and the supplied vector.
|
double |
angleCos(Vector4dc v)
Return the cosine of the angle between this vector and the supplied vector.
|
Vector4d |
ceil()
Set each component of this vector to the smallest (closest to negative
infinity)
double value that is greater than or equal to that
component and is equal to a mathematical integer. |
Vector4d |
ceil(Vector4d 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,
double z,
double w)
Return the distance between
this vector and (x, y, z, w). |
static double |
distance(double x1,
double y1,
double z1,
double w1,
double x2,
double y2,
double z2,
double w2)
Return the distance between
(x1, y1, z1, w1) and (x2, y2, z2, w2). |
double |
distance(Vector4dc v)
Return the distance between this Vector and
v. |
double |
distanceSquared(double x,
double y,
double z,
double w)
Return the square of the distance between
this vector and
(x, y, z, w). |
static double |
distanceSquared(double x1,
double y1,
double z1,
double w1,
double x2,
double y2,
double z2,
double w2)
Return the squared distance between
(x1, y1, z1, w1) and (x2, y2, z2, w2). |
double |
distanceSquared(Vector4dc v)
Return the square of the distance between this vector and
v. |
Vector4d |
div(double scalar)
Divide this Vector4d by the given scalar value.
|
Vector4d |
div(double scalar,
Vector4d dest)
Divide this Vector4d by the given scalar value and store the result in
dest. |
Vector4d |
div(Vector4dc v)
|
Vector4d |
div(Vector4dc v,
Vector4d dest)
|
double |
dot(double x,
double y,
double z,
double w)
Compute the dot product (inner product) of this vector and
(x, y, z, w). |
double |
dot(Vector4dc v)
Compute the dot product (inner product) of this vector and
v. |
boolean |
equals(double x,
double y,
double z,
double w)
Compare the vector components of
this vector with the given (x, y, z, w)
and return whether all of them are equal. |
boolean |
equals(Object obj) |
boolean |
equals(Vector4dc 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. |
Vector4d |
floor()
Set each component of this vector to the largest (closest to positive
infinity)
double value that is less than or equal to that
component and is equal to a mathematical integer. |
Vector4d |
floor(Vector4d 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. |
Vector4d |
fma(double a,
Vector4dc b)
Add the component-wise multiplication of
a * b to this vector. |
Vector4d |
fma(double a,
Vector4dc b,
Vector4d dest)
Add the component-wise multiplication of
a * b to this vector
and store the result in dest. |
Vector4d |
fma(Vector4dc a,
Vector4dc b)
Add the component-wise multiplication of
a * b to this vector. |
Vector4d |
fma(Vector4dc a,
Vector4dc b,
Vector4d 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. |
int |
hashCode() |
Vector4d |
hermite(Vector4dc t0,
Vector4dc v1,
Vector4dc t1,
double t,
Vector4d dest)
Compute a hermite interpolation between
this vector and its
associated tangent t0 and the given vector v
with its tangent t1 and store the result in
dest. |
boolean |
isFinite()
|
double |
length()
Return the length of this vector.
|
static double |
length(double x,
double y,
double z,
double w)
Get the length of a 4-dimensional double-precision vector.
|
double |
lengthSquared()
Return the length squared of this vector.
|
static double |
lengthSquared(double x,
double y,
double z,
double w)
Get the length squared of a 4-dimensional double-precision vector.
|
Vector4d |
lerp(Vector4dc other,
double t)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in this. |
Vector4d |
lerp(Vector4dc other,
double t,
Vector4d dest)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in dest. |
Vector4d |
max(Vector4dc v)
Set the components of this vector to be the component-wise maximum of this and the other vector.
|
Vector4d |
max(Vector4dc v,
Vector4d 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.
|
Vector4d |
min(Vector4dc v)
Set the components of this vector to be the component-wise minimum of this and the other vector.
|
Vector4d |
min(Vector4dc v,
Vector4d 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.
|
Vector4d |
mul(double scalar)
Multiply this Vector4d by the given scalar value.
|
Vector4d |
mul(double scalar,
Vector4d dest)
Multiply this Vector4d by the given scalar value and store the result in
dest. |
Vector4d |
mul(Matrix4dc mat)
Multiply the given matrix
mat with this Vector4d. |
Vector4d |
mul(Matrix4dc mat,
Vector4d dest)
Multiply the given matrix mat with this
Vector4d and store the result in dest. |
Vector4d |
mul(Matrix4fc mat)
Multiply the given matrix
mat with this Vector4d. |
Vector4d |
mul(Matrix4fc mat,
Vector4d dest)
Multiply the given matrix mat with this Vector4d and store the result in
dest. |
Vector4d |
mul(Matrix4x3dc mat)
Multiply the given matrix mat with this Vector4d and store the result in
this. |
Vector4d |
mul(Matrix4x3dc mat,
Vector4d dest)
Multiply the given matrix mat with this Vector4d and store the result in
dest. |
Vector4d |
mul(Matrix4x3fc mat)
Multiply the given matrix mat with this Vector4d and store the result in
this. |
Vector4d |
mul(Matrix4x3fc mat,
Vector4d dest)
Multiply the given matrix mat with this Vector4d and store the result in
dest. |
Vector4d |
mul(Vector4dc v)
|
Vector4d |
mul(Vector4dc v,
Vector4d dest)
|
Vector4d |
mul(Vector4fc v)
|
Vector4d |
mul(Vector4fc v,
Vector4d dest)
|
Vector4d |
mulAffine(Matrix4dc mat,
Vector4d dest) |
Vector4d |
mulProject(Matrix4dc mat)
Multiply the given matrix
mat with this Vector4d, perform perspective division. |
Vector4d |
mulProject(Matrix4dc mat,
Vector4d dest)
Multiply the given matrix
mat with this Vector4d, perform perspective division
and store the result in dest. |
Vector4d |
negate()
Negate this vector.
|
Vector4d |
negate(Vector4d dest)
Negate this vector and store the result in
dest. |
Vector4d |
normalize()
Normalizes this vector.
|
Vector4d |
normalize(double length)
Scale this vector to have the given length.
|
Vector4d |
normalize(double length,
Vector4d dest)
Scale this vector to have the given length and store the result in
dest. |
Vector4d |
normalize(Vector4d dest)
Normalizes this vector and store the result in
dest. |
Vector4d |
normalize3()
Normalize this vector by computing only the norm of
(x, y, z). |
Vector4d |
normalize3(Vector4d dest)
Normalize this vector by computing only the norm of
(x, y, z) and store the result in dest. |
void |
readExternal(ObjectInput in) |
Vector4d |
rotate(Quaterniondc quat)
Transform this vector by the given quaternion
quat and store the result in this. |
Vector4d |
rotate(Quaterniondc quat,
Vector4d dest)
Transform this vector by the given quaternion
quat and store the result in dest. |
Vector4d |
rotateAxis(double angle,
double x,
double y,
double z)
Rotate this vector the specified radians around the given rotation axis.
|
Vector4d |
rotateAxis(double angle,
double aX,
double aY,
double aZ,
Vector4d dest)
Rotate this vector the specified radians around the given rotation axis and store the result
into
dest. |
Vector4d |
rotateX(double angle)
Rotate this vector the specified radians around the X axis.
|
Vector4d |
rotateX(double angle,
Vector4d dest)
Rotate this vector the specified radians around the X axis and store the result
into
dest. |
Vector4d |
rotateY(double angle)
Rotate this vector the specified radians around the Y axis.
|
Vector4d |
rotateY(double angle,
Vector4d dest)
Rotate this vector the specified radians around the Y axis and store the result
into
dest. |
Vector4d |
rotateZ(double angle)
Rotate this vector the specified radians around the Z axis.
|
Vector4d |
rotateZ(double angle,
Vector4d dest)
Rotate this vector the specified radians around the Z axis and store the result
into
dest. |
Vector4d |
round()
Set each component of this vector to the closest double that is equal to
a mathematical integer, with ties rounding to positive infinity.
|
Vector4d |
round(Vector4d 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. |
Vector4d |
set(ByteBuffer buffer)
Read this vector from the supplied
ByteBuffer at the current
buffer position. |
Vector4d |
set(double d)
Set the x, y, z, and w components to the supplied value.
|
Vector4d |
set(DoubleBuffer buffer)
Read this vector from the supplied
DoubleBuffer at the current
buffer position. |
Vector4d |
set(double x,
double y,
double z,
double w)
Set the x, y, z, and w components to the supplied values.
|
Vector4d |
set(int index,
ByteBuffer buffer)
Read this vector from the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
Vector4d |
set(int index,
DoubleBuffer buffer)
Read this vector from the supplied
DoubleBuffer starting at the specified
absolute buffer position/index. |
Vector4d |
set(Vector2dc v,
double z,
double w)
Set the x and y components from the given
v
and the z and w components to the given z and w. |
Vector4d |
set(Vector2fc v,
double z,
double w)
Set the x and y components from the given
v
and the z and w components to the given z and w. |
Vector4d |
set(Vector2ic v,
double z,
double w)
Set the x and y components from the given
v
and the z and w components to the given z and w. |
Vector4d |
set(Vector3dc v,
double w)
Set the x, y, and z components of this to the components of
v and the w component to w. |
Vector4d |
set(Vector3fc v,
double w)
Set the x, y, and z components of this to the components of
v and the w component to w. |
Vector4d |
set(Vector3ic v,
double w)
Set the x, y, and z components of this to the components of
v and the w component to w. |
Vector4d |
set(Vector4dc v)
Set this
Vector4d to the values of the given v. |
Vector4d |
set(Vector4fc v)
Set this
Vector4d to the values of the given v. |
Vector4d |
set(Vector4ic v)
Set this
Vector4d to the values of the given v. |
Vector4d |
setComponent(int component,
double value)
Set the value of the specified component of this vector.
|
Vector4d |
smoothStep(Vector4dc v,
double t,
Vector4d dest)
Compute a smooth-step (i.e.
|
Vector4d |
sub(double x,
double y,
double z,
double w)
Subtract
(x, y, z, w) from this. |
Vector4d |
sub(double x,
double y,
double z,
double w,
Vector4d dest)
Subtract
(x, y, z, w) from this and store the result in dest. |
Vector4d |
sub(Vector4dc v)
Subtract the supplied vector from this one.
|
Vector4d |
sub(Vector4dc v,
Vector4d dest)
Subtract the supplied vector from this one and store the result in
dest. |
Vector4d |
sub(Vector4fc v)
Subtract the supplied vector from this one.
|
Vector4d |
sub(Vector4fc v,
Vector4d dest)
Subtract the supplied vector from this one and store the result in
dest. |
String |
toString()
Return a string representation of this vector.
|
String |
toString(NumberFormat formatter)
Return a string representation of this vector by formatting the vector components with the given
NumberFormat. |
double |
w() |
void |
writeExternal(ObjectOutput out) |
double |
x() |
double |
y() |
double |
z() |
Vector4d |
zero()
Set all components to zero.
|
public double x
public double y
public double z
public double w
public Vector4d()
Vector4d of (0, 0, 0, 1).public Vector4d(Vector4dc v)
Vector4d with the same values as v.v - the Vector4dc to copy the values frompublic Vector4d(Vector4ic v)
Vector4d with the same values as v.v - the Vector4ic to copy the values frompublic Vector4d(Vector2dc v, double z, double w)
v - the Vector2dcz - the z componentw - the w componentpublic Vector4d(Vector2ic v, double z, double w)
v - the Vector2icz - the z componentw - the w componentpublic Vector4d(double d)
Vector4d and initialize all four components with the given value.d - the value of all four componentspublic Vector4d(Vector4fc v)
Vector4d with the same values as v.v - the Vector4fc to copy the values frompublic Vector4d(Vector3fc v, double w)
Vector4d with the x, y, and z components from the
given v and the w component from the given w.v - the Vector3fcw - the w componentpublic Vector4d(Vector2fc v, double z, double w)
Vector4d with the x and y components from the
given v and the z and w components from the given z and w.v - the Vector2fcz - the z componentw - the w componentpublic Vector4d(double x,
double y,
double z,
double w)
Vector4d with the given component values.x - the x componenty - the y componentz - the z componentw - the w componentpublic Vector4d(ByteBuffer buffer)
Vector4d and read this vector from the supplied 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 read, use Vector4d(int, ByteBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderVector4d(int, ByteBuffer)public Vector4d(int index,
ByteBuffer buffer)
Vector4d and read this vector from the supplied 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 - values will be read in x, y, z, w orderpublic Vector4d(DoubleBuffer buffer)
Vector4d and read this vector from the supplied 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 read, use Vector4d(int, DoubleBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderVector4d(int, DoubleBuffer)public Vector4d(int index,
DoubleBuffer buffer)
Vector4d and read this vector from the supplied 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 - values will be read in x, y, z, w orderpublic Vector4d set(Vector4dc v)
Vector4d to the values of the given v.v - the vector whose values will be copied into thispublic Vector4d set(Vector4fc v)
Vector4d to the values of the given v.v - the vector whose values will be copied into thispublic Vector4d set(Vector4ic v)
Vector4d to the values of the given v.v - the vector whose values will be copied into thispublic Vector4d set(Vector3dc v, double w)
v and the w component to w.v - the Vector3dc to copyw - the w componentpublic Vector4d set(Vector3ic v, double w)
v and the w component to w.v - the Vector3ic to copyw - the w componentpublic Vector4d set(Vector3fc v, double w)
v and the w component to w.v - the Vector3fc to copyw - the w componentpublic Vector4d set(Vector2dc v, double z, double w)
v
and the z and w components to the given z and w.v - the Vector2dcz - the z componentw - the w componentpublic Vector4d set(Vector2ic v, double z, double w)
v
and the z and w components to the given z and w.v - the Vector2icz - the z componentw - the w componentpublic Vector4d set(double d)
d - the value of all four componentspublic Vector4d set(Vector2fc v, double z, double w)
v
and the z and w components to the given z and w.v - the Vector2fcz - the z componentsw - the w componentspublic Vector4d set(double x, double y, double z, double w)
x - the x componenty - the y componentz - the z componentw - the w componentpublic Vector4d set(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 read, use set(int, ByteBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderset(int, ByteBuffer)public Vector4d set(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 - values will be read in x, y, z, w orderpublic Vector4d set(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 read, use set(int, DoubleBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderset(int, DoubleBuffer)public Vector4d set(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 - values will be read in x, y, z, w orderpublic Vector4d setComponent(int component, double value) throws IllegalArgumentException
component - the component whose value to set, within [0..3]value - the value to setIllegalArgumentException - if component is not within [0..3]public ByteBuffer get(ByteBuffer buffer)
Vector4dcByteBuffer 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 Vector4dc.get(int, ByteBuffer), taking
the absolute position as parameter.
get in interface Vector4dcbuffer - will receive the values of this vector in x, y, z, w orderVector4dc.get(int, ByteBuffer)public ByteBuffer get(int index, ByteBuffer buffer)
Vector4dcByteBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
public DoubleBuffer get(DoubleBuffer buffer)
Vector4dcDoubleBuffer 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 Vector4dc.get(int, DoubleBuffer), taking
the absolute position as parameter.
get in interface Vector4dcbuffer - will receive the values of this vector in x, y, z, w orderVector4dc.get(int, DoubleBuffer)public DoubleBuffer get(int index, DoubleBuffer buffer)
Vector4dcDoubleBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given DoubleBuffer.
public Vector4d sub(Vector4dc v)
v - the vector to subtractpublic Vector4d sub(Vector4dc v, Vector4d dest)
dest.public Vector4d sub(Vector4fc v)
v - the vector to subtractpublic Vector4d sub(Vector4fc v, Vector4d dest)
dest.public Vector4d sub(double x, double y, double z, double w)
(x, y, z, w) from this.x - the x component to subtracty - the y component to subtractz - the z component to subtractw - the w component to subtractpublic Vector4d sub(double x, double y, double z, double w, Vector4d dest)
Vector4dc(x, y, z, w) from this and store the result in dest.public Vector4d add(Vector4dc v)
v - the vector to addpublic Vector4d add(Vector4dc v, Vector4d dest)
Vector4dcdest.public Vector4d add(Vector4fc v, Vector4d dest)
Vector4dcdest.public Vector4d add(double x, double y, double z, double w)
(x, y, z, w) to this.x - the x component to addy - the y component to addz - the z component to addw - the w component to addpublic Vector4d add(double x, double y, double z, double w, Vector4d dest)
Vector4dc(x, y, z, w) to this and store the result in dest.public Vector4d add(Vector4fc v)
v - the vector to addpublic Vector4d fma(Vector4dc a, Vector4dc b)
a * b to this vector.a - the first multiplicandb - the second multiplicandpublic Vector4d fma(double a, Vector4dc b)
a * b to this vector.a - the first multiplicandb - the second multiplicandpublic Vector4d fma(Vector4dc a, Vector4dc b, Vector4d dest)
Vector4dca * b to this vector
and store the result in dest.public Vector4d fma(double a, Vector4dc b, Vector4d dest)
Vector4dca * b to this vector
and store the result in dest.public Vector4d mul(Vector4dc v)
v - the vector to multiply bypublic Vector4d div(Vector4dc v)
v - the vector to divide bypublic Vector4d mul(Vector4fc v)
v - the vector to multiply bypublic Vector4d mul(Matrix4dc mat)
mat with this Vector4d.mat - the matrix to multiply bypublic Vector4d mul(Matrix4dc mat, Vector4d dest)
Vector4dcVector4d and store the result in dest.public Vector4d mul(Matrix4x3dc mat)
this.mat - the matrix to multiply the vector withpublic Vector4d mul(Matrix4x3dc mat, Vector4d dest)
Vector4dcdest.public Vector4d mul(Matrix4x3fc mat)
this.mat - the matrix to multiply the vector withpublic Vector4d mul(Matrix4x3fc mat, Vector4d dest)
Vector4dcdest.public Vector4d mul(Matrix4fc mat)
mat with this Vector4d.mat - the matrix to multiply bypublic Vector4d mul(Matrix4fc mat, Vector4d dest)
Vector4dcdest.public Vector4d mulProject(Matrix4dc mat, Vector4d dest)
Vector4dcmat with this Vector4d, perform perspective division
and store the result in dest.mulProject in interface Vector4dcmat - the matrix to multiply this vector bydest - will hold the resultpublic Vector4d mulProject(Matrix4dc mat)
mat with this Vector4d, perform perspective division.mat - the matrix to multiply this vector bypublic Vector4d mul(double scalar)
scalar - the scalar to multiply bypublic Vector4d mul(double scalar, Vector4d dest)
Vector4dcdest.public Vector4d div(double scalar)
scalar - the scalar to divide bypublic Vector4d div(double scalar, Vector4d dest)
Vector4dcdest.public Vector4d rotate(Quaterniondc quat)
quat and store the result in this.quat - the quaternion to transform this vectorQuaterniond.transform(Vector4d)public Vector4d rotate(Quaterniondc quat, Vector4d dest)
Vector4dcquat and store the result in dest.rotate in interface Vector4dcquat - the quaternion to transform this vectordest - will hold the resultQuaterniond.transform(Vector4d)public Vector4d rotateAxis(double angle, double x, double y, double z)
angle - the angle in radiansx - the x component of the rotation axisy - the y component of the rotation axisz - the z component of the rotation axispublic Vector4d rotateAxis(double angle, double aX, double aY, double aZ, Vector4d dest)
Vector4dcdest.rotateAxis in interface Vector4dcangle - the angle in radiansaX - the x component of the rotation axisaY - the y component of the rotation axisaZ - the z component of the rotation axisdest - will hold the resultpublic Vector4d rotateX(double angle)
angle - the angle in radianspublic Vector4d rotateX(double angle, Vector4d dest)
Vector4dcdest.public Vector4d rotateY(double angle)
angle - the angle in radianspublic Vector4d rotateY(double angle, Vector4d dest)
Vector4dcdest.public Vector4d rotateZ(double angle)
angle - the angle in radianspublic Vector4d rotateZ(double angle, Vector4d dest)
Vector4dcdest.public double lengthSquared()
Vector4dclengthSquared in interface Vector4dcpublic static double lengthSquared(double x,
double y,
double z,
double w)
x - The vector's x componenty - The vector's y componentz - The vector's z componentw - The vector's w componentpublic double length()
Vector4dcpublic static double length(double x,
double y,
double z,
double w)
x - The vector's x componenty - The vector's y componentz - The vector's z componentw - The vector's w componentpublic Vector4d normalize()
public Vector4d normalize(Vector4d dest)
Vector4dcdest.public Vector4d normalize(double length)
length - the desired lengthpublic Vector4d normalize(double length, Vector4d dest)
Vector4dcdest.public Vector4d normalize3()
(x, y, z).public Vector4d normalize3(Vector4d dest)
Vector4dc(x, y, z) and store the result in dest.normalize3 in interface Vector4dcdest - will hold the resultpublic double distance(Vector4dc v)
Vector4dcv.public double distance(double x,
double y,
double z,
double w)
Vector4dcthis vector and (x, y, z, w).public double distanceSquared(Vector4dc v)
Vector4dcv.distanceSquared in interface Vector4dcv - the other vectorpublic double distanceSquared(double x,
double y,
double z,
double w)
Vector4dcthis vector and
(x, y, z, w).distanceSquared in interface Vector4dcx - the x component of the other vectory - the y component of the other vectorz - the z component of the other vectorw - the w component of the other vectorpublic static double distance(double x1,
double y1,
double z1,
double w1,
double x2,
double y2,
double z2,
double w2)
(x1, y1, z1, w1) and (x2, y2, z2, w2).x1 - the x component of the first vectory1 - the y component of the first vectorz1 - the z component of the first vectorw1 - the w component of the first vectorx2 - the x component of the second vectory2 - the y component of the second vectorz2 - the z component of the second vectorw2 - the 2 component of the second vectorpublic static double distanceSquared(double x1,
double y1,
double z1,
double w1,
double x2,
double y2,
double z2,
double w2)
(x1, y1, z1, w1) and (x2, y2, z2, w2).x1 - the x component of the first vectory1 - the y component of the first vectorz1 - the z component of the first vectorw1 - the w component of the first vectorx2 - the x component of the second vectory2 - the y component of the second vectorz2 - the z component of the second vectorw2 - the w component of the second vectorpublic double dot(Vector4dc v)
Vector4dcv.public double dot(double x,
double y,
double z,
double w)
Vector4dc(x, y, z, w).public double angleCos(Vector4dc v)
Vector4dc
Use this instead of Math.cos(angle(v)).
angleCos in interface Vector4dcv - the other vectorVector4dc.angle(Vector4dc)public double angle(Vector4dc v)
Vector4dcangle in interface Vector4dcv - the other vectorVector4dc.angleCos(Vector4dc)public Vector4d zero()
public Vector4d negate()
public Vector4d negate(Vector4d dest)
Vector4dcdest.public Vector4d min(Vector4dc v)
v - the other vectorpublic Vector4d min(Vector4dc v, Vector4d dest)
Vector4dcdest to be the component-wise minimum of this and the other vector.public Vector4d max(Vector4dc v)
v - the other vectorpublic Vector4d max(Vector4dc v, Vector4d dest)
Vector4dcdest to be the component-wise maximum of this and the other vector.public String toString()
This method creates a new DecimalFormat on every invocation with the format string "0.000E0;-".
public String toString(NumberFormat formatter)
NumberFormat.formatter - the NumberFormat used to format the vector components withpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic boolean equals(Vector4dc v, double delta)
Vector4dcthis 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.
public boolean equals(double x,
double y,
double z,
double w)
Vector4dcthis vector with the given (x, y, z, w)
and return whether all of them are equal.public Vector4d smoothStep(Vector4dc v, double t, Vector4d dest)
Vector4dcthis vector and the given vector v and
store the result in dest.smoothStep in interface Vector4dcv - the other vectort - the interpolation factor, within [0..1]dest - will hold the resultpublic Vector4d hermite(Vector4dc t0, Vector4dc v1, Vector4dc t1, double t, Vector4d dest)
Vector4dcthis vector and its
associated tangent t0 and the given vector v
with its tangent t1 and store the result in
dest.public Vector4d lerp(Vector4dc other, double t)
this and other using the given interpolation factor t
and store the result in this.
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.0public Vector4d lerp(Vector4dc other, double t, Vector4d dest)
Vector4dcthis 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.
public double get(int component)
throws IllegalArgumentException
Vector4dcget in interface Vector4dccomponent - the component, within [0..3]IllegalArgumentException - if component is not within [0..3]public int maxComponent()
Vector4dcmaxComponent in interface Vector4dc[0..3]public int minComponent()
Vector4dcminComponent in interface Vector4dc[0..3]public Vector4d floor()
double value that is less than or equal to that
component and is equal to a mathematical integer.public Vector4d floor(Vector4d dest)
Vector4dcdouble value that is less than or equal to that
component and is equal to a mathematical integer and store the result in
dest.public Vector4d ceil()
double value that is greater than or equal to that
component and is equal to a mathematical integer.public Vector4d ceil(Vector4d dest)
Vector4dcdouble value that is greater than or equal to that
component and is equal to a mathematical integer and store the result in
dest.public Vector4d round()
public Vector4d round(Vector4d dest)
Vector4dcdest.public boolean isFinite()
Vector4dcCopyright © 2015–2019 JOML. All rights reserved.