Class Vector4d
- All Implemented Interfaces:
- Externalizable,- Serializable,- Cloneable,- Vector4dc
- Author:
- Richard Greenlees, Kai Burjack, F. Neurath
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionVector4d()Create a newVector4dof(0, 0, 0, 1).Vector4d(double d) Create a newVector4dand initialize all four components with the given value.Vector4d(double[] xyzw) Create a newVector4dand initialize its four components from the first four elements of the given array.Vector4d(double x, double y, double z, double w) Create a newVector4dwith the given component values.Vector4d(float[] xyzw) Create a newVector4dand initialize its four components from the first four elements of the given array.Vector4d(int index, ByteBuffer buffer) Create a newVector4dand read this vector from the suppliedByteBufferstarting at the specified absolute buffer position/index.Vector4d(int index, DoubleBuffer buffer) Create a newVector4dand read this vector from the suppliedDoubleBufferstarting at the specified absolute buffer position/index.Vector4d(ByteBuffer buffer) Create a newVector4dand read this vector from the suppliedByteBufferat the current bufferposition.Vector4d(DoubleBuffer buffer) Create a newVector4dand read this vector from the suppliedDoubleBufferat the current bufferposition.Create a newVector4dwith the x and y components from the givenvand the z and w components from the givenzandw.Create a newVector4dwith the x, y, and z components from the givenvand the w component from the givenw.Create a newVector4dwith the same values asv.Create a newVector4dwith the same values asv.Create a newVector4dwith the same values asv.
- 
Method SummaryModifier and TypeMethodDescriptionabsolute()Compute the absolute of each of this vector's components.Compute the absolute of each of this vector's components and store the result intodest.add(double x, double y, double z, double w) Add(x, y, z, w)to this.Add(x, y, z, w)to this and store the result indest.Add the supplied vector to this one.Add the supplied vector to this one and store the result indest.Add the supplied vector to this one.Add the supplied vector to this one and store the result indest.doubleReturn the angle between this vector and the supplied vector.doubleReturn the cosine of the angle between this vector and the supplied vector.ceil()Set each component of this vector to the smallest (closest to negative infinity)doublevalue that is greater than or equal to that component and is equal to a mathematical integer.Compute for each component of this vector the smallest (closest to negative infinity)doublevalue that is greater than or equal to that component and is equal to a mathematical integer and store the result indest.clone()doubledistance(double x, double y, double z, double w) Return the distance betweenthisvector and(x, y, z, w).static doubledistance(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).doubleReturn the distance between this Vector andv.doubledistanceSquared(double x, double y, double z, double w) Return the square of the distance betweenthisvector and(x, y, z, w).static doubledistanceSquared(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).doubleReturn the square of the distance between this vector andv.div(double scalar) Divide this Vector4d by the given scalar value.Divide this Vector4d by the given scalar value and store the result indest.doubledot(double x, double y, double z, double w) Compute the dot product (inner product) of this vector and(x, y, z, w).doubleCompute the dot product (inner product) of this vector andv.booleanequals(double x, double y, double z, double w) Compare the vector components ofthisvector with the given(x, y, z, w)and return whether all of them are equal.booleanbooleanCompare the vector components ofthisvector with the given vector using the givendeltaand return whether all of them are equal within a maximum difference ofdelta.floor()Set each component of this vector to the largest (closest to positive infinity)doublevalue that is less than or equal to that component and is equal to a mathematical integer.Compute for each component of this vector the largest (closest to positive infinity)doublevalue that is less than or equal to that component and is equal to a mathematical integer and store the result indest.Add the component-wise multiplication ofa * bto this vector.Add the component-wise multiplication ofa * bto this vector and store the result indest.Add the component-wise multiplication ofa * bto this vector.Add the component-wise multiplication ofa * bto this vector and store the result indest.doubleget(int component) Get the value of the specified component of this vector.get(int index, ByteBuffer buffer) Store this vector into the suppliedByteBufferstarting at the specified absolute buffer position/index.get(int index, DoubleBuffer buffer) Store this vector into the suppliedDoubleBufferstarting at the specified absolute buffer position/index.get(int index, FloatBuffer buffer) Store this vector into the suppliedFloatBufferstarting at the specified absolute buffer position/index.get(ByteBuffer buffer) Store this vector into the suppliedByteBufferat the current bufferposition.get(DoubleBuffer buffer) Store this vector into the suppliedDoubleBufferat the current bufferposition.get(FloatBuffer buffer) Store this vector into the suppliedFloatBufferat the current bufferposition.Set the components of the given vectordestto those ofthisvector.Set the components of the given vectordestto those ofthisvector.getf(int index, ByteBuffer buffer) Store this vector into the suppliedByteBufferstarting at the specified absolute buffer position/index.getf(ByteBuffer buffer) Store this vector into the suppliedByteBufferat the current bufferposition.getToAddress(long address) Store this vector at the given off-heap memory address.inthashCode()Compute a hermite interpolation betweenthisvector and its associated tangentt0and the given vectorvwith its tangentt1and store the result indest.booleanisFinite()doublelength()Return the length of this vector.static doublelength(double x, double y, double z, double w) Get the length of a 4-dimensional double-precision vector.doubleReturn the length squared of this vector.static doublelengthSquared(double x, double y, double z, double w) Get the length squared of a 4-dimensional double-precision vector.Linearly interpolatethisandotherusing the given interpolation factortand store the result inthis.Linearly interpolatethisandotherusing the given interpolation factortand store the result indest.Set the components of this vector to be the component-wise maximum of this and the other vector.Set the components ofdestto be the component-wise maximum of this and the other vector.intDetermine the component with the biggest absolute value.Set the components of this vector to be the component-wise minimum of this and the other vector.Set the components ofdestto be the component-wise minimum of this and the other vector.intDetermine the component with the smallest (towards zero) absolute value.mul(double scalar) Multiply this Vector4d by the given scalar value.Multiply this Vector4d by the given scalar value and store the result indest.Multiply the given matrixmatwith thisVector4d.Multiply the given matrix mat with thisVector4dand store the result indest.Multiply the given matrixmatwith thisVector4d.Multiply the given matrix mat with this Vector4d and store the result indest.mul(Matrix4x3dc mat) Multiply the given matrix mat with this Vector4d and store the result inthis.mul(Matrix4x3dc mat, Vector4d dest) Multiply the given matrix mat with this Vector4d and store the result indest.mul(Matrix4x3fc mat) Multiply the given matrix mat with this Vector4d and store the result inthis.mul(Matrix4x3fc mat, Vector4d dest) Multiply the given matrix mat with this Vector4d and store the result indest.Add the component-wise multiplication ofthis * atoband store the result inthis.Add the component-wise multiplication ofthis * atoband store the result indest.Add the component-wise multiplication ofthis * atoband store the result inthis.Add the component-wise multiplication ofthis * atoband store the result indest.Multiply the given affine matrix mat with this Vector4d and store the result indest.mulAffineTranspose(Matrix4dc mat, Vector4d dest) Multiply the transpose of the given affine matrixmatwith this Vector4d and store the result indest.mulProject(Matrix4dc mat) Multiply the given matrixmatwith this Vector4d, perform perspective division.mulProject(Matrix4dc mat, Vector3d dest) Multiply the given matrixmatwith this Vector4d, perform perspective division and store the(x, y, z)result indest.mulProject(Matrix4dc mat, Vector4d dest) Multiply the given matrixmatwith this Vector4d, perform perspective division and store the result indest.mulTranspose(Matrix4dc mat) Multiply the transpose of the given matrixmatwith this Vector4f and store the result inthis.mulTranspose(Matrix4dc mat, Vector4d dest) Multiply the transpose of the given matrixmatwith this Vector4d and store the result indest.negate()Negate this vector.Negate this vector and store the result indest.Normalizes this vector.normalize(double length) Scale this vector to have the given length.Scale this vector to have the given length and store the result indest.Normalizes this vector and store the result indest.Normalize this vector by computing only the norm of(x, y, z).normalize3(Vector4d dest) Normalize this vector by computing only the norm of(x, y, z)and store the result indest.voidrotate(Quaterniondc quat) Transform this vector by the given quaternionquatand store the result inthis.rotate(Quaterniondc quat, Vector4d dest) Transform this vector by the given quaternionquatand store the result indest.rotateAxis(double angle, double x, double y, double z) Rotate this vector the specified radians around the given rotation axis.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 intodest.rotateX(double angle) Rotate this vector the specified radians around the X axis.Rotate this vector the specified radians around the X axis and store the result intodest.rotateY(double angle) Rotate this vector the specified radians around the Y axis.Rotate this vector the specified radians around the Y axis and store the result intodest.rotateZ(double angle) Rotate this vector the specified radians around the Z axis.Rotate this vector the specified radians around the Z axis and store the result intodest.round()Set each component of this vector to the closest double that is equal to a mathematical integer, with ties rounding to positive infinity.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 indest.set(double d) Set the x, y, z, and w components to the supplied value.set(double[] xyzw) Set the four components of this vector to the first four elements of the given array.set(double x, double y, double z) Set the x, y, z components to the supplied values.set(double x, double y, double z, double w) Set the x, y, z, and w components to the supplied values.set(float[] xyzw) Set the four components of this vector to the first four elements of the given array.set(int index, ByteBuffer buffer) Read this vector from the suppliedByteBufferstarting at the specified absolute buffer position/index.set(int index, DoubleBuffer buffer) Read this vector from the suppliedDoubleBufferstarting at the specified absolute buffer position/index.set(ByteBuffer buffer) Read this vector from the suppliedByteBufferat the current bufferposition.set(DoubleBuffer buffer) Read this vector from the suppliedDoubleBufferat the current bufferposition.Set the x and y components from the givenvand the z and w components to the givenzandw.Set the x and y components from the givenvand the z and w components to the givenzandw.Set the x and y components from the givenvand the z and w components to the givenzandw.Set the x, y, and z components of this to the components ofvand the w component tow.Set the x, y, and z components of this to the components ofvand the w component tow.Set the x, y, and z components of this to the components ofvand the w component tow.Set thisVector4dto the values of the givenv.Set thisVector4dto the values of the givenv.Set thisVector4dto the values of the givenv.setComponent(int component, double value) Set the value of the specified component of this vector.setFromAddress(long address) Set the values of this vector by reading 4 double values from off-heap memory, starting at the given address.smoothStep(Vector4dc v, double t, Vector4d dest) Compute a smooth-step (i.e.sub(double x, double y, double z, double w) Subtract(x, y, z, w)from this.Subtract(x, y, z, w)from this and store the result indest.Subtract the supplied vector from this one.Subtract the supplied vector from this one and store the result indest.Subtract the supplied vector from this one.Subtract the supplied vector from this one and store the result indest.toString()Return a string representation of this vector.toString(NumberFormat formatter) Return a string representation of this vector by formatting the vector components with the givenNumberFormat.doublew()voiddoublex()doubley()doublez()zero()Set all components to zero.
- 
Field Details- 
xpublic double xThe x component of the vector.
- 
ypublic double yThe y component of the vector.
- 
zpublic double zThe z component of the vector.
- 
wpublic double wThe w component of the vector.
 
- 
- 
Constructor Details- 
Vector4dpublic Vector4d()Create a newVector4dof(0, 0, 0, 1).
- 
Vector4dCreate a newVector4dwith the same values asv.- Parameters:
- v- the- Vector4dcto copy the values from
 
- 
Vector4dCreate a newVector4dwith the same values asv.- Parameters:
- v- the- Vector4icto copy the values from
 
- 
Vector4d- Parameters:
- v- the- Vector3dc
- w- the w component
 
- 
Vector4d- Parameters:
- v- the- Vector3ic
- w- the w component
 
- 
Vector4d- Parameters:
- v- the- Vector2dc
- z- the z component
- w- the w component
 
- 
Vector4d- Parameters:
- v- the- Vector2ic
- z- the z component
- w- the w component
 
- 
Vector4dpublic Vector4d(double d) Create a newVector4dand initialize all four components with the given value.- Parameters:
- d- the value of all four components
 
- 
Vector4dCreate a newVector4dwith the same values asv.- Parameters:
- v- the- Vector4fcto copy the values from
 
- 
Vector4dCreate a newVector4dwith the x, y, and z components from the givenvand the w component from the givenw.- Parameters:
- v- the- Vector3fc
- w- the w component
 
- 
Vector4dCreate a newVector4dwith the x and y components from the givenvand the z and w components from the givenzandw.- Parameters:
- v- the- Vector2fc
- z- the z component
- w- the w component
 
- 
Vector4dpublic Vector4d(double x, double y, double z, double w) Create a newVector4dwith the given component values.- Parameters:
- x- the x component
- y- the y component
- z- the z component
- w- the w component
 
- 
Vector4dpublic Vector4d(float[] xyzw) Create a newVector4dand initialize its four components from the first four elements of the given array.- Parameters:
- xyzw- the array containing at least four elements
 
- 
Vector4dpublic Vector4d(double[] xyzw) Create a newVector4dand initialize its four components from the first four elements of the given array.- Parameters:
- xyzw- the array containing at least four elements
 
- 
Vector4dCreate a newVector4dand read this vector from the suppliedByteBufferat the current bufferposition.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.- Parameters:
- buffer- values will be read in- x, y, z, worder
- See Also:
 
- 
Vector4dCreate a newVector4dand read this vector from the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer. - Parameters:
- index- the absolute position into the ByteBuffer
- buffer- values will be read in- x, y, z, worder
 
- 
Vector4dCreate a newVector4dand read this vector from the suppliedDoubleBufferat the current bufferposition.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.- Parameters:
- buffer- values will be read in- x, y, z, worder
- See Also:
 
- 
Vector4dCreate a newVector4dand read this vector from the suppliedDoubleBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given DoubleBuffer. - Parameters:
- index- the absolute position into the DoubleBuffer
- buffer- values will be read in- x, y, z, worder
 
 
- 
- 
Method Details- 
xpublic double x()
- 
ypublic double y()
- 
zpublic double z()
- 
wpublic double w()
- 
setSet thisVector4dto the values of the givenv.- Parameters:
- v- the vector whose values will be copied into this
- Returns:
- this
 
- 
setSet thisVector4dto the values of the givenv.- Parameters:
- v- the vector whose values will be copied into this
- Returns:
- this
 
- 
setSet thisVector4dto the values of the givenv.- Parameters:
- v- the vector whose values will be copied into this
- Returns:
- this
 
- 
setSet the x, y, and z components of this to the components ofvand the w component tow.- Parameters:
- v- the- Vector3dcto copy
- w- the w component
- Returns:
- this
 
- 
setSet the x, y, and z components of this to the components ofvand the w component tow.- Parameters:
- v- the- Vector3icto copy
- w- the w component
- Returns:
- this
 
- 
setSet the x, y, and z components of this to the components ofvand the w component tow.- Parameters:
- v- the- Vector3fcto copy
- w- the w component
- Returns:
- this
 
- 
setSet the x and y components from the givenvand the z and w components to the givenzandw.- Parameters:
- v- the- Vector2dc
- z- the z component
- w- the w component
- Returns:
- this
 
- 
setSet the x and y components from the givenvand the z and w components to the givenzandw.- Parameters:
- v- the- Vector2ic
- z- the z component
- w- the w component
- Returns:
- this
 
- 
setSet the x, y, z, and w components to the supplied value.- Parameters:
- d- the value of all four components
- Returns:
- this
 
- 
setSet the x and y components from the givenvand the z and w components to the givenzandw.- Parameters:
- v- the- Vector2fc
- z- the z components
- w- the w components
- Returns:
- this
 
- 
setSet the x, y, z, and w components to the supplied values.- Parameters:
- x- the x component
- y- the y component
- z- the z component
- w- the w component
- Returns:
- this
 
- 
setSet the x, y, z components to the supplied values.- Parameters:
- x- the x component
- y- the y component
- z- the z component
- Returns:
- this
 
- 
setSet the four components of this vector to the first four elements of the given array.- Parameters:
- xyzw- the array containing at least four elements
- Returns:
- this
 
- 
setSet the four components of this vector to the first four elements of the given array.- Parameters:
- xyzw- the array containing at least four elements
- Returns:
- this
 
- 
setRead this vector from the suppliedByteBufferat the current bufferposition.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.- Parameters:
- buffer- values will be read in- x, y, z, worder
- Returns:
- this
- See Also:
 
- 
setRead this vector from the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer. - Parameters:
- index- the absolute position into the ByteBuffer
- buffer- values will be read in- x, y, z, worder
- Returns:
- this
 
- 
setRead this vector from the suppliedDoubleBufferat the current bufferposition.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.- Parameters:
- buffer- values will be read in- x, y, z, worder
- Returns:
- this
- See Also:
 
- 
setRead this vector from the suppliedDoubleBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given DoubleBuffer. - Parameters:
- index- the absolute position into the DoubleBuffer
- buffer- values will be read in- x, y, z, worder
- Returns:
- this
 
- 
setFromAddressSet the values of this vector by reading 4 double values from off-heap memory, starting at the given address.This method will throw an UnsupportedOperationExceptionwhen JOML is used with `-Djoml.nounsafe`.This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process. - Parameters:
- address- the off-heap memory address to read the vector values from
- Returns:
- this
 
- 
setComponentSet the value of the specified component of this vector.- Parameters:
- component- the component whose value to set, within- [0..3]
- value- the value to set
- Returns:
- this
- Throws:
- IllegalArgumentException- if- componentis not within- [0..3]
 
- 
getDescription copied from interface:Vector4dcStore this vector into the suppliedByteBufferat the current bufferposition.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.
- 
getDescription copied from interface:Vector4dcStore this vector into the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer. 
- 
getDescription copied from interface:Vector4dcStore this vector into the suppliedDoubleBufferat the current bufferposition.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.
- 
getDescription copied from interface:Vector4dcStore this vector into the suppliedDoubleBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given DoubleBuffer. 
- 
getfDescription copied from interface:Vector4dcStore this vector into the suppliedByteBufferat the current bufferposition.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.Please note that due to this vector storing double values those values will potentially lose precision when they are converted to float values before being put into the given ByteBuffer. 
- 
getfDescription copied from interface:Vector4dcStore this vector into the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer. Please note that due to this vector storing double values those values will potentially lose precision when they are converted to float values before being put into the given ByteBuffer. 
- 
getDescription copied from interface:Vector4dcStore this vector into the suppliedFloatBufferat the current bufferposition.This method will not increment the position of the given FloatBuffer. In order to specify the offset into the FloatBuffer at which the vector is stored, use Vector4dc.get(int, FloatBuffer), taking the absolute position as parameter.Please note that due to this vector storing double values those values will potentially lose precision when they are converted to float values before being put into the given FloatBuffer. 
- 
getDescription copied from interface:Vector4dcStore this vector into the suppliedFloatBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given FloatBuffer. Please note that due to this vector storing double values those values will potentially lose precision when they are converted to float values before being put into the given FloatBuffer. 
- 
getToAddressDescription copied from interface:Vector4dcStore this vector at the given off-heap memory address.This method will throw an UnsupportedOperationExceptionwhen JOML is used with `-Djoml.nounsafe`.This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process. - Specified by:
- getToAddressin interface- Vector4dc
- Parameters:
- address- the off-heap address where to store this vector
- Returns:
- this
 
- 
subSubtract the supplied vector from this one.- Parameters:
- v- the vector to subtract
- Returns:
- this
 
- 
subSubtract the supplied vector from this one and store the result indest.
- 
subSubtract the supplied vector from this one.- Parameters:
- v- the vector to subtract
- Returns:
- this
 
- 
subSubtract the supplied vector from this one and store the result indest.
- 
subSubtract(x, y, z, w)from this.- Parameters:
- x- the x component to subtract
- y- the y component to subtract
- z- the z component to subtract
- w- the w component to subtract
- Returns:
- this
 
- 
subDescription copied from interface:Vector4dcSubtract(x, y, z, w)from this and store the result indest.
- 
addAdd the supplied vector to this one.- Parameters:
- v- the vector to add
- Returns:
- this
 
- 
addDescription copied from interface:Vector4dcAdd the supplied vector to this one and store the result indest.
- 
addDescription copied from interface:Vector4dcAdd the supplied vector to this one and store the result indest.
- 
addAdd(x, y, z, w)to this.- Parameters:
- x- the x component to add
- y- the y component to add
- z- the z component to add
- w- the w component to add
- Returns:
- this
 
- 
addDescription copied from interface:Vector4dcAdd(x, y, z, w)to this and store the result indest.
- 
addAdd the supplied vector to this one.- Parameters:
- v- the vector to add
- Returns:
- this
 
- 
fmaAdd the component-wise multiplication ofa * bto this vector.- Parameters:
- a- the first multiplicand
- b- the second multiplicand
- Returns:
- this
 
- 
fmaAdd the component-wise multiplication ofa * bto this vector.- Parameters:
- a- the first multiplicand
- b- the second multiplicand
- Returns:
- this
 
- 
fmaDescription copied from interface:Vector4dcAdd the component-wise multiplication ofa * bto this vector and store the result indest.
- 
fmaDescription copied from interface:Vector4dcAdd the component-wise multiplication ofa * bto this vector and store the result indest.
- 
mulAddAdd the component-wise multiplication ofthis * atoband store the result inthis.- Parameters:
- a- the multiplicand
- b- the addend
- Returns:
- this
 
- 
mulAddAdd the component-wise multiplication ofthis * atoband store the result inthis.- Parameters:
- a- the multiplicand
- b- the addend
- Returns:
- this
 
- 
mulAddDescription copied from interface:Vector4dcAdd the component-wise multiplication ofthis * atoband store the result indest.
- 
mulAddDescription copied from interface:Vector4dcAdd the component-wise multiplication ofthis * atoband store the result indest.
- 
mul- Parameters:
- v- the vector to multiply by
- Returns:
- this
 
- 
mulDescription copied from interface:Vector4dc
- 
div- Parameters:
- v- the vector to divide by
- Returns:
- this
 
- 
divDescription copied from interface:Vector4dc
- 
mul- Parameters:
- v- the vector to multiply by
- Returns:
- this
 
- 
mulDescription copied from interface:Vector4dc
- 
mulMultiply the given matrixmatwith thisVector4d.- Parameters:
- mat- the matrix to multiply by
- Returns:
- this
 
- 
mulDescription copied from interface:Vector4dcMultiply the given matrix mat with thisVector4dand store the result indest.
- 
mulTransposeMultiply the transpose of the given matrixmatwith this Vector4f and store the result inthis.- Parameters:
- mat- the matrix whose transpose to multiply the vector with
- Returns:
- this
 
- 
mulTransposeDescription copied from interface:Vector4dcMultiply the transpose of the given matrixmatwith this Vector4d and store the result indest.- Specified by:
- mulTransposein interface- Vector4dc
- Parameters:
- mat- the matrix whose transpose to multiply the vector with
- dest- the destination vector to hold the result
- Returns:
- dest
 
- 
mulAffineDescription copied from interface:Vector4dcMultiply the given affine matrix mat with this Vector4d and store the result indest.
- 
mulAffineTransposeDescription copied from interface:Vector4dcMultiply the transpose of the given affine matrixmatwith this Vector4d and store the result indest.- Specified by:
- mulAffineTransposein interface- Vector4dc
- Parameters:
- mat- the affine matrix whose transpose to multiply the vector with
- dest- the destination vector to hold the result
- Returns:
- dest
 
- 
mulMultiply the given matrix mat with this Vector4d and store the result inthis.- Parameters:
- mat- the matrix to multiply the vector with
- Returns:
- this
 
- 
mulDescription copied from interface:Vector4dcMultiply the given matrix mat with this Vector4d and store the result indest.
- 
mulMultiply the given matrix mat with this Vector4d and store the result inthis.- Parameters:
- mat- the matrix to multiply the vector with
- Returns:
- this
 
- 
mulDescription copied from interface:Vector4dcMultiply the given matrix mat with this Vector4d and store the result indest.
- 
mulMultiply the given matrixmatwith thisVector4d.- Parameters:
- mat- the matrix to multiply by
- Returns:
- this
 
- 
mulDescription copied from interface:Vector4dcMultiply the given matrix mat with this Vector4d and store the result indest.
- 
mulProjectDescription copied from interface:Vector4dcMultiply the given matrixmatwith this Vector4d, perform perspective division and store the result indest.- Specified by:
- mulProjectin interface- Vector4dc
- Parameters:
- mat- the matrix to multiply this vector by
- dest- will hold the result
- Returns:
- dest
 
- 
mulProjectMultiply the given matrixmatwith this Vector4d, perform perspective division.- Parameters:
- mat- the matrix to multiply this vector by
- Returns:
- this
 
- 
mulProjectDescription copied from interface:Vector4dcMultiply the given matrixmatwith this Vector4d, perform perspective division and store the(x, y, z)result indest.- Specified by:
- mulProjectin interface- Vector4dc
- Parameters:
- mat- the matrix to multiply this vector by
- dest- will hold the result
- Returns:
- dest
 
- 
mulMultiply this Vector4d by the given scalar value.- Parameters:
- scalar- the scalar to multiply by
- Returns:
- this
 
- 
mulDescription copied from interface:Vector4dcMultiply this Vector4d by the given scalar value and store the result indest.
- 
divDivide this Vector4d by the given scalar value.- Parameters:
- scalar- the scalar to divide by
- Returns:
- this
 
- 
divDescription copied from interface:Vector4dcDivide this Vector4d by the given scalar value and store the result indest.
- 
rotateTransform this vector by the given quaternionquatand store the result inthis.- Parameters:
- quat- the quaternion to transform this vector
- Returns:
- this
- See Also:
 
- 
rotateDescription copied from interface:Vector4dcTransform this vector by the given quaternionquatand store the result indest.
- 
rotateAxisRotate this vector the specified radians around the given rotation axis.- Parameters:
- angle- the angle in radians
- x- the x component of the rotation axis
- y- the y component of the rotation axis
- z- the z component of the rotation axis
- Returns:
- this
 
- 
rotateAxisDescription copied from interface:Vector4dcRotate this vector the specified radians around the given rotation axis and store the result intodest.- Specified by:
- rotateAxisin interface- Vector4dc
- Parameters:
- angle- the angle in radians
- aX- the x component of the rotation axis
- aY- the y component of the rotation axis
- aZ- the z component of the rotation axis
- dest- will hold the result
- Returns:
- dest
 
- 
rotateXRotate this vector the specified radians around the X axis.- Parameters:
- angle- the angle in radians
- Returns:
- this
 
- 
rotateXDescription copied from interface:Vector4dcRotate this vector the specified radians around the X axis and store the result intodest.
- 
rotateYRotate this vector the specified radians around the Y axis.- Parameters:
- angle- the angle in radians
- Returns:
- this
 
- 
rotateYDescription copied from interface:Vector4dcRotate this vector the specified radians around the Y axis and store the result intodest.
- 
rotateZRotate this vector the specified radians around the Z axis.- Parameters:
- angle- the angle in radians
- Returns:
- this
 
- 
rotateZDescription copied from interface:Vector4dcRotate this vector the specified radians around the Z axis and store the result intodest.
- 
lengthSquaredpublic double lengthSquared()Description copied from interface:Vector4dcReturn the length squared of this vector.- Specified by:
- lengthSquaredin interface- Vector4dc
- Returns:
- the length squared
 
- 
lengthSquaredpublic static double lengthSquared(double x, double y, double z, double w) Get the length squared of a 4-dimensional double-precision vector.- Parameters:
- x- The vector's x component
- y- The vector's y component
- z- The vector's z component
- w- The vector's w component
- Returns:
- the length squared of the given vector
 
- 
lengthpublic double length()Description copied from interface:Vector4dcReturn the length of this vector.
- 
lengthpublic static double length(double x, double y, double z, double w) Get the length of a 4-dimensional double-precision vector.- Parameters:
- x- The vector's x component
- y- The vector's y component
- z- The vector's z component
- w- The vector's w component
- Returns:
- the length of the given vector
 
- 
normalizeNormalizes this vector.- Returns:
- this
 
- 
normalizeDescription copied from interface:Vector4dcNormalizes this vector and store the result indest.
- 
normalizeScale this vector to have the given length.- Parameters:
- length- the desired length
- Returns:
- this
 
- 
normalizeDescription copied from interface:Vector4dcScale this vector to have the given length and store the result indest.
- 
normalize3Normalize this vector by computing only the norm of(x, y, z).- Returns:
- this
 
- 
normalize3Description copied from interface:Vector4dcNormalize this vector by computing only the norm of(x, y, z)and store the result indest.- Specified by:
- normalize3in interface- Vector4dc
- Parameters:
- dest- will hold the result
- Returns:
- dest
 
- 
distanceDescription copied from interface:Vector4dcReturn the distance between this Vector andv.
- 
distancepublic double distance(double x, double y, double z, double w) Description copied from interface:Vector4dcReturn the distance betweenthisvector and(x, y, z, w).
- 
distanceSquaredDescription copied from interface:Vector4dcReturn the square of the distance between this vector andv.- Specified by:
- distanceSquaredin interface- Vector4dc
- Parameters:
- v- the other vector
- Returns:
- the squared of the distance
 
- 
distanceSquaredpublic double distanceSquared(double x, double y, double z, double w) Description copied from interface:Vector4dcReturn the square of the distance betweenthisvector and(x, y, z, w).- Specified by:
- distanceSquaredin interface- Vector4dc
- Parameters:
- x- the x component of the other vector
- y- the y component of the other vector
- z- the z component of the other vector
- w- the w component of the other vector
- Returns:
- the square of the distance
 
- 
distancepublic 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).- Parameters:
- x1- the x component of the first vector
- y1- the y component of the first vector
- z1- the z component of the first vector
- w1- the w component of the first vector
- x2- the x component of the second vector
- y2- the y component of the second vector
- z2- the z component of the second vector
- w2- the 2 component of the second vector
- Returns:
- the euclidean distance
 
- 
distanceSquaredpublic 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).- Parameters:
- x1- the x component of the first vector
- y1- the y component of the first vector
- z1- the z component of the first vector
- w1- the w component of the first vector
- x2- the x component of the second vector
- y2- the y component of the second vector
- z2- the z component of the second vector
- w2- the w component of the second vector
- Returns:
- the euclidean distance squared
 
- 
dotDescription copied from interface:Vector4dcCompute the dot product (inner product) of this vector andv.
- 
dotpublic double dot(double x, double y, double z, double w) Description copied from interface:Vector4dcCompute the dot product (inner product) of this vector and(x, y, z, w).
- 
angleCosDescription copied from interface:Vector4dcReturn the cosine of the angle between this vector and the supplied vector.Use this instead of Math.cos(angle(v)).
- 
angleDescription copied from interface:Vector4dcReturn the angle between this vector and the supplied vector.
- 
zeroSet all components to zero.- Returns:
- this
 
- 
negateNegate this vector.- Returns:
- this
 
- 
negateDescription copied from interface:Vector4dcNegate this vector and store the result indest.
- 
minSet the components of this vector to be the component-wise minimum of this and the other vector.- Parameters:
- v- the other vector
- Returns:
- this
 
- 
minDescription copied from interface:Vector4dcSet the components ofdestto be the component-wise minimum of this and the other vector.
- 
maxSet the components of this vector to be the component-wise maximum of this and the other vector.- Parameters:
- v- the other vector
- Returns:
- this
 
- 
maxDescription copied from interface:Vector4dcSet the components ofdestto be the component-wise maximum of this and the other vector.
- 
toStringReturn a string representation of this vector.This method creates a new DecimalFormaton every invocation with the format string "0.000E0;-".
- 
toStringReturn a string representation of this vector by formatting the vector components with the givenNumberFormat.- Parameters:
- formatter- the- NumberFormatused to format the vector components with
- Returns:
- the string representation
 
- 
writeExternal- Specified by:
- writeExternalin interface- Externalizable
- Throws:
- IOException
 
- 
readExternal- Specified by:
- readExternalin interface- Externalizable
- Throws:
- IOException
- ClassNotFoundException
 
- 
hashCodepublic int hashCode()
- 
equals
- 
equalsDescription copied from interface:Vector4dcCompare the vector components ofthisvector with the given vector using the givendeltaand return whether all of them are equal within a maximum difference ofdelta.Please note that this method is not used by any data structure such as ArrayListHashSetorHashMapand their operations, such asArrayList.contains(Object)orHashSet.remove(Object), since those data structures only use theObject.equals(Object)andObject.hashCode()methods.
- 
equalspublic boolean equals(double x, double y, double z, double w) Description copied from interface:Vector4dcCompare the vector components ofthisvector with the given(x, y, z, w)and return whether all of them are equal.
- 
smoothStepDescription copied from interface:Vector4dcCompute a smooth-step (i.e. hermite with zero tangents) interpolation betweenthisvector and the given vectorvand store the result indest.- Specified by:
- smoothStepin interface- Vector4dc
- Parameters:
- v- the other vector
- t- the interpolation factor, within- [0..1]
- dest- will hold the result
- Returns:
- dest
 
- 
hermiteDescription copied from interface:Vector4dcCompute a hermite interpolation betweenthisvector and its associated tangentt0and the given vectorvwith its tangentt1and store the result indest.
- 
lerpLinearly interpolatethisandotherusing the given interpolation factortand store the result inthis.If tis0.0then the result isthis. If the interpolation factor is1.0then the result isother.- Parameters:
- other- the other vector
- t- the interpolation factor between 0.0 and 1.0
- Returns:
- this
 
- 
lerpDescription copied from interface:Vector4dcLinearly interpolatethisandotherusing the given interpolation factortand store the result indest.If tis0.0then the result isthis. If the interpolation factor is1.0then the result isother.
- 
getDescription copied from interface:Vector4dcGet the value of the specified component of this vector.- Specified by:
- getin interface- Vector4dc
- Parameters:
- component- the component, within- [0..3]
- Returns:
- the value
- Throws:
- IllegalArgumentException- if- componentis not within- [0..3]
 
- 
getDescription copied from interface:Vector4dc- Specified by:
- getin interface- Vector4dc
- Parameters:
- mode- the- RoundingModeto use
- dest- will hold the result
- Returns:
- dest
 
- 
getDescription copied from interface:Vector4dcSet the components of the given vectordestto those ofthisvector.
- 
getDescription copied from interface:Vector4dcSet the components of the given vectordestto those ofthisvector.
- 
maxComponentpublic int maxComponent()Description copied from interface:Vector4dcDetermine the component with the biggest absolute value.- Specified by:
- maxComponentin interface- Vector4dc
- Returns:
- the component index, within [0..3]
 
- 
minComponentpublic int minComponent()Description copied from interface:Vector4dcDetermine the component with the smallest (towards zero) absolute value.- Specified by:
- minComponentin interface- Vector4dc
- Returns:
- the component index, within [0..3]
 
- 
floorSet each component of this vector to the largest (closest to positive infinity)doublevalue that is less than or equal to that component and is equal to a mathematical integer.- Returns:
- this
 
- 
floorDescription copied from interface:Vector4dcCompute for each component of this vector the largest (closest to positive infinity)doublevalue that is less than or equal to that component and is equal to a mathematical integer and store the result indest.
- 
ceilSet each component of this vector to the smallest (closest to negative infinity)doublevalue that is greater than or equal to that component and is equal to a mathematical integer.- Returns:
- this
 
- 
ceilDescription copied from interface:Vector4dcCompute for each component of this vector the smallest (closest to negative infinity)doublevalue that is greater than or equal to that component and is equal to a mathematical integer and store the result indest.
- 
roundSet each component of this vector to the closest double that is equal to a mathematical integer, with ties rounding to positive infinity.- Returns:
- this
 
- 
roundDescription copied from interface:Vector4dcCompute 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 indest.
- 
isFinitepublic boolean isFinite()Description copied from interface:Vector4dc
- 
absoluteCompute the absolute of each of this vector's components.- Returns:
- this
 
- 
absoluteDescription copied from interface:Vector4dcCompute the absolute of each of this vector's components and store the result intodest.
- 
clone- Overrides:
- clonein class- Object
- Throws:
- CloneNotSupportedException
 
 
-