Vector4d

Contains the definition of a Vector comprising 4 doubles and associated transformations.

@author Richard Greenlees @author Kai Burjack @author F. Neurath

struct Vector4d {}

Constructors

this
this(Vector4d v)

Create a new {@link Vector4d} with the same values as <code>v</code>.

this
this(Vector4i v)

Create a new {@link Vector4d} with the same values as <code>v</code>.

this
this(Vector3d v, double w)

Create a new {@link Vector4d} with the first three components from the given <code>v</code> and the given <code>w</code>.

this
this(Vector3i v, double w)

Create a new {@link Vector4d} with the first three components from the given <code>v</code> and the given <code>w</code>.

this
this(Vector2d v, double z, double w)

Create a new {@link Vector4d} with the first two components from the given <code>v</code> and the given <code>z</code> and <code>w</code>.

this
this(Vector2i v, double z, double w)

Create a new {@link Vector4d} with the first two components from the given <code>v</code> and the given <code>z</code> and <code>w</code>.

this
this(double d)

Create a new {@link Vector4d} and initialize all four components with the given value.

this
this(double x, double y, double z, double w)

Create a new {@link Vector4d} with the given component values.

this
this(float[] xyzw)

Create a new {@link Vector4d} and initialize its four components from the first four elements of the given array.

this
this(double[] xyzw)

Create a new {@link Vector4d} and initialize its four components from the first four elements of the given array.

Members

Functions

absolute
Vector4d absolute()

Compute the absolute of each of this vector's components.

absolute
Vector4d absolute(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
add
Vector4d add(Vector4d v)

Add the supplied vector to this one.

add
Vector4d add(Vector4d v, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
add
Vector4d add(double x, double y, double z, double w)

Add <code>(x, y, z, w)</code> to this.

add
Vector4d add(double x, double y, double z, double w, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
angle
double angle(Vector4d v)
Undocumented in source. Be warned that the author may not have intended to support it.
angleCos
double angleCos(Vector4d v)
Undocumented in source. Be warned that the author may not have intended to support it.
ceil
Vector4d ceil()

Set each component of this vector to the smallest (closest to negative infinity) {@code double} value that is greater than or equal to that component and is equal to a mathematical integer.

ceil
Vector4d ceil(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
distance
double distance(Vector4d v)
Undocumented in source. Be warned that the author may not have intended to support it.
distance
double distance(double x, double y, double z, double w)
Undocumented in source. Be warned that the author may not have intended to support it.
distanceSquared
double distanceSquared(Vector4d v)
Undocumented in source. Be warned that the author may not have intended to support it.
distanceSquared
double distanceSquared(double x, double y, double z, double w)
Undocumented in source. Be warned that the author may not have intended to support it.
div
Vector4d div(Vector4d v)

Divide this {@link Vector4d} component-wise by the given {@link Vector4d}.

div
Vector4d div(Vector4d v, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
div
Vector4d div(double scalar)

Divide this Vector4d by the given scalar value.

div
Vector4d div(double scalar, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
dot
double dot(Vector4d v)
Undocumented in source. Be warned that the author may not have intended to support it.
dot
double dot(double x, double y, double z, double w)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(Vector4d v, double delta)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(Vector4d other)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(double x, double y, double z, double w)
Undocumented in source. Be warned that the author may not have intended to support it.
floor
Vector4d floor()

Set each component of this vector to the largest (closest to positive infinity) {@code double} value that is less than or equal to that component and is equal to a mathematical integer.

floor
Vector4d floor(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
fma
Vector4d fma(Vector4d a, Vector4d b)

Add the component-wise multiplication of <code>a * b</code> to this vector.

fma
Vector4d fma(double a, Vector4d b)

Add the component-wise multiplication of <code>a * b</code> to this vector.

fma
Vector4d fma(Vector4d a, Vector4d b, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
fma
Vector4d fma(double a, Vector4d b, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
get
double get(int component)
Undocumented in source. Be warned that the author may not have intended to support it.
get
Vector4i get(int mode, Vector4i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
get
Vector4d get(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
hashCode
int hashCode()
Undocumented in source. Be warned that the author may not have intended to support it.
hermite
Vector4d hermite(Vector4d t0, Vector4d v1, Vector4d t1, double t, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
isFinite
bool isFinite()
Undocumented in source. Be warned that the author may not have intended to support it.
length
double length()
Undocumented in source. Be warned that the author may not have intended to support it.
lengthSquared
double lengthSquared()
Undocumented in source. Be warned that the author may not have intended to support it.
lerp
Vector4d lerp(Vector4d other, double t)

Linearly interpolate <code>this</code> and <code>other</code> using the given interpolation factor <code>t</code> and store the result in <code>this</code>. <p> If <code>t</code> is <code>0.0</code> then the result is <code>this</code>. If the interpolation factor is <code>1.0</code> then the result is <code>other</code>.

lerp
Vector4d lerp(Vector4d other, double t, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
max
Vector4d max(Vector4d v)

Set the components of this vector to be the component-wise maximum of this and the other vector.

max
Vector4d max(Vector4d v, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
maxComponent
int maxComponent()
Undocumented in source. Be warned that the author may not have intended to support it.
min
Vector4d min(Vector4d v)

Set the components of this vector to be the component-wise minimum of this and the other vector.

min
Vector4d min(Vector4d v, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
minComponent
int minComponent()
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Vector4d mul(Vector4d v)

Multiply this {@link Vector4d} component-wise by the given {@link Vector4d}.

mul
Vector4d mul(Vector4d v, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Vector4d mul(Matrix4d mat)

Multiply the given matrix <code>mat</code> with this {@link Vector4d}.

mul
Vector4d mul(Matrix4d mat, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Vector4d mul(Matrix4x3d mat)

Multiply the given matrix mat with this Vector4d and store the result in <code>this</code>.

mul
Vector4d mul(Matrix4x3d mat, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Vector4d mul(double scalar)

Multiply this Vector4d by the given scalar value.

mul
Vector4d mul(double scalar, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mulAdd
Vector4d mulAdd(Vector4d a, Vector4d b)

Add the component-wise multiplication of <code>this * a</code> to <code>b</code> and store the result in <code>this</code>.

mulAdd
Vector4d mulAdd(double a, Vector4d b)

Add the component-wise multiplication of <code>this * a</code> to <code>b</code> and store the result in <code>this</code>.

mulAdd
Vector4d mulAdd(Vector4d a, Vector4d b, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mulAdd
Vector4d mulAdd(double a, Vector4d b, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mulAffine
Vector4d mulAffine(Matrix4d mat, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mulAffineTranspose
Vector4d mulAffineTranspose(Matrix4d mat, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mulProject
Vector4d mulProject(Matrix4d mat, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mulProject
Vector4d mulProject(Matrix4d mat)

Multiply the given matrix <code>mat</code> with this Vector4d, perform perspective division.

mulProject
Vector3d mulProject(Matrix4d mat, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mulTranspose
Vector4d mulTranspose(Matrix4d mat)

Multiply the transpose of the given matrix <code>mat</code> with this Vector4f and store the result in <code>this</code>.

mulTranspose
Vector4d mulTranspose(Matrix4d mat, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
negate
Vector4d negate()

Negate this vector.

negate
Vector4d negate(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
normalize
Vector4d normalize()

Normalizes this vector.

normalize
Vector4d normalize(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
normalize
Vector4d normalize(double length)

Scale this vector to have the given length.

normalize
Vector4d normalize(double length, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
normalize3
Vector4d normalize3()

Normalize this vector by computing only the norm of <code>(x, y, z)</code>.

normalize3
Vector4d normalize3(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotate
Vector4d rotate(Quaterniond quat)

Transform this vector by the given quaternion <code>quat</code> and store the result in <code>this</code>.

rotate
Vector4d rotate(Quaterniond quat, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateAxis
Vector4d rotateAxis(double angle, double x, double y, double z)

Rotate this vector the specified radians around the given rotation axis.

rotateAxis
Vector4d rotateAxis(double angle, double aX, double aY, double aZ, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateX
Vector4d rotateX(double angle)

Rotate this vector the specified radians around the X axis.

rotateX
Vector4d rotateX(double angle, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateY
Vector4d rotateY(double angle)

Rotate this vector the specified radians around the Y axis.

rotateY
Vector4d rotateY(double angle, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateZ
Vector4d rotateZ(double angle)

Rotate this vector the specified radians around the Z axis.

rotateZ
Vector4d rotateZ(double angle, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
round
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.

round
Vector4d round(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
set
Vector4d set(Vector4d v)

Set this {@link Vector4d} to the values of the given <code>v</code>.

set
Vector4d set(Vector4i v)

Set this {@link Vector4d} to the values of the given <code>v</code>.

set
Vector4d set(Vector3d v, double w)

Set the x, y, and z components of this to the components of <code>v</code> and the w component to <code>w</code>.

set
Vector4d set(Vector3i v, double w)

Set the x, y, and z components of this to the components of <code>v</code> and the w component to <code>w</code>.

set
Vector4d set(Vector2d v, double z, double w)

Set the x and y components from the given <code>v</code> and the z and w components to the given <code>z</code> and <code>w</code>.

set
Vector4d set(Vector2i v, double z, double w)

Set the x and y components from the given <code>v</code> and the z and w components to the given <code>z</code> and <code>w</code>.

set
Vector4d set(double d)

Set the x, y, z, and w components to the supplied value.

set
Vector4d set(double x, double y, double z, double w)

Set the x, y, z, and w components to the supplied values.

set
Vector4d set(double x, double y, double z)

Set the x, y, z components to the supplied values.

set
Vector4d set(double[] xyzw)

Set the four components of this vector to the first four elements of the given array.

set
Vector4d set(float[] xyzw)

Set the four components of this vector to the first four elements of the given array.

setComponent
Vector4d setComponent(int component, double value)

Set the value of the specified component of this vector.

smoothStep
Vector4d smoothStep(Vector4d v, double t, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
sub
Vector4d sub(Vector4d v)

Subtract the supplied vector from this one.

sub
Vector4d sub(Vector4d v, Vector4d dest)

Subtract the supplied vector from this one and store the result in <code>dest</code>.

sub
Vector4d sub(double x, double y, double z, double w)

Subtract <code>(x, y, z, w)</code> from this.

sub
Vector4d sub(double x, double y, double z, double w, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
zero
Vector4d zero()

Set all components to zero.

Static functions

distance
double distance(double x1, double y1, double z1, double w1, double x2, double y2, double z2, double w2)

Return the distance between <code>(x1, y1, z1, w1)</code> and <code>(x2, y2, z2, w2)</code>.

distanceSquared
double distanceSquared(double x1, double y1, double z1, double w1, double x2, double y2, double z2, double w2)

Return the squared distance between <code>(x1, y1, z1, w1)</code> and <code>(x2, y2, z2, w2)</code>.

length
double length(double x, double y, double z, double w)

Get the length of a 4-dimensional double-precision vector.

lengthSquared
double lengthSquared(double x, double y, double z, double w)

Get the length squared of a 4-dimensional double-precision vector.

Variables

w
double w;

The w component of the vector.

x
double x;

The x component of the vector.

y
double y;

The y component of the vector.

z
double z;

The z component of the vector.

Meta