Class Vector4L
- java.lang.Object
-
- org.joml.Vector4L
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,Vector4Lc
public class Vector4L extends java.lang.Object implements java.io.Externalizable, java.lang.Cloneable, Vector4Lc
Contains the definition of a vector comprising 4 longs and associated transformations.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Vector4L()Create a newVector4Lof(0, 0, 0, 1).Vector4L(int[] xyzw)Create a newVector4Land initialize its four components from the first four elements of the given array.Vector4L(int index, java.nio.ByteBuffer buffer)Create a newVector4Land read this vector from the suppliedByteBufferstarting at the specified absolute buffer position/index.Vector4L(int index, java.nio.LongBuffer buffer)Create a newVector4Land read this vector from the suppliedLongBufferstarting at the specified absolute buffer position/index.Vector4L(long s)Create a newVector4Land initialize all four components with the given value.Vector4L(long x, long y, long z, long w)Create a newVector4Lwith the given component values.Vector4L(java.nio.ByteBuffer buffer)Create a newVector4Land read this vector from the suppliedByteBufferat the current bufferposition.Vector4L(java.nio.LongBuffer buffer)Create a newVector4Land read this vector from the suppliedLongBufferat the current bufferposition.Vector4L(Vector2ic v, long z, long w)Vector4L(Vector2Lc v, long z, long w)Vector4L(Vector3fc v, float w, int mode)Create a newVector4Lwith the first three components from the givenvand the givenwand round using the givenRoundingMode.Vector4L(Vector3ic v, long w)Vector4L(Vector3Lc v, long w)Vector4L(Vector4dc v, int mode)Create a newVector4Land initialize its components to the rounded value of the given vector.Vector4L(Vector4fc v, int mode)Create a newVector4Land initialize its components to the rounded value of the given vector.Vector4L(Vector4ic v)Create a newVector4Lwith the same values asv.Vector4L(Vector4Lc v)Create a newVector4Lwith the same values asv.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector4Labsolute()Compute the absolute of each of this vector's components.Vector4Labsolute(Vector4L dest)Compute the absolute of each of this vector's components and store the result intodest.Vector4Ladd(long x, long y, long z, long w)Increment the components of this vector by the given values.Vector4Ladd(long x, long y, long z, long w, Vector4L dest)Increment the components of this vector by the given values and store the result indest.Vector4Ladd(Vector4ic v)Add the supplied vector to this one.Vector4Ladd(Vector4ic v, Vector4L dest)Add the supplied vector to this one and store the result indest.Vector4Ladd(Vector4Lc v)Add the supplied vector to this one.Vector4Ladd(Vector4Lc v, Vector4L dest)Add the supplied vector to this one and store the result indest.java.lang.Objectclone()doubledistance(long x, long y, long z, long w)Return the distance betweenthisvector and(x, y, z, w).static doubledistance(long x1, long y1, long z1, long w1, long x2, long y2, long z2, long w2)Return the distance between(x1, y1, z1, w1)and(x2, y2, z2, w2).doubledistance(Vector4ic v)Return the distance between this Vector andv.doubledistance(Vector4Lc v)Return the distance between this Vector andv.longdistanceSquared(long x, long y, long z, long w)Return the square of the distance betweenthisvector and(x, y, z, w).static longdistanceSquared(long x1, long y1, long z1, long w1, long x2, long y2, long z2, long w2)Return the squared distance between(x1, y1, z1, w1)and(x2, y2, z2, w2).longdistanceSquared(Vector4ic v)Return the square of the distance between this vector andv.longdistanceSquared(Vector4Lc v)Return the square of the distance between this vector andv.Vector4Ldiv(float scalar)Divide all components of this vector by the given scalar value.Vector4Ldiv(float scalar, Vector4L dest)Divide all components of this vector by the given scalar value and store the result indest.Vector4Ldiv(long scalar)Divide all components of this vector by the given scalar value.Vector4Ldiv(long scalar, Vector4L dest)Divide all components of this vector by the given scalar value and store the result indest.Vector4Ldiv(Vector4ic v)Divide this Vector4L component-wise by another vector.Vector4Ldiv(Vector4ic v, Vector4L dest)Divide this Vector4L component-wise by another Vector4ic and store the result indest.Vector4Ldiv(Vector4Lc v)Divide this Vector4L component-wise by another vector.Vector4Ldiv(Vector4Lc v, Vector4L dest)Divide this Vector4L component-wise by another Vector4Lc and store the result indest.longdot(Vector4ic v)Compute the dot product (inner product) of this vector andv.longdot(Vector4Lc v)Compute the dot product (inner product) of this vector andv.booleanequals(long x, long y, long z, long w)Compare the vector components ofthisvector with the given(x, y, z, w)and return whether all of them are equal.booleanequals(java.lang.Object obj)longget(int component)Get the value of the specified component of this vector.java.nio.ByteBufferget(int index, java.nio.ByteBuffer buffer)Store this vector into the suppliedByteBufferstarting at the specified absolute buffer position/index.java.nio.LongBufferget(int index, java.nio.LongBuffer buffer)Store this vector into the suppliedLongBufferstarting at the specified absolute buffer position/index.java.nio.ByteBufferget(java.nio.ByteBuffer buffer)Store this vector into the suppliedByteBufferat the current bufferposition.java.nio.LongBufferget(java.nio.LongBuffer buffer)Store this vector into the suppliedLongBufferat the current bufferposition.Vector4LcgetToAddress(long address)Store this vector at the given off-heap memory address.longgridDistance(long x, long y, long z, long w)Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)(x, y).longgridDistance(Vector4ic v)Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)(x, y).longgridDistance(Vector4Lc v)Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)(x, y).inthashCode()doublelength()Return the length of this vector.static doublelength(long x, long y, long z, long w)Get the length of a 4-dimensional single-precision vector.longlengthSquared()Return the length squared of this vector.static longlengthSquared(long x, long y, long z, long w)Get the length squared of a 4-dimensional single-precision vector.Vector4Lmax(Vector4Lc v)Set the components of this vector to be the component-wise maximum of this and the other vector.Vector4Lmax(Vector4Lc v, Vector4L dest)Set the components ofdestto be the component-wise maximum of this and the other vector.intmaxComponent()Determine the component with the biggest absolute value.Vector4Lmin(Vector4Lc v)Set the components of this vector to be the component-wise minimum of this and the other vector.Vector4Lmin(Vector4Lc v, Vector4L dest)Set the components ofdestto be the component-wise minimum of this and the other vector.intminComponent()Determine the component with the smallest (towards zero) absolute value.Vector4Lmul(long scalar)Multiply all components of this vector by the given scalar value.Vector4Lmul(long scalar, Vector4L dest)Multiply all components of this vector by the given scalar value and store the result indest.Vector4Lmul(Vector4ic v)Multiply this Vector4L component-wise by another vector.Vector4Lmul(Vector4ic v, Vector4L dest)Multiply this Vector4L component-wise by another Vector4ic and store the result indest.Vector4Lmul(Vector4Lc v)Multiply this Vector4L component-wise by another vector.Vector4Lmul(Vector4Lc v, Vector4L dest)Multiply this Vector4L component-wise by another Vector4Lc and store the result indest.Vector4Lnegate()Negate this vector.Vector4Lnegate(Vector4L dest)Negate this vector and store the result indest.voidreadExternal(java.io.ObjectInput in)Vector4Lset(int[] xyzw)Set the four components of this vector to the first four elements of the given array.Vector4Lset(int index, java.nio.ByteBuffer buffer)Read this vector from the suppliedByteBufferstarting at the specified absolute buffer position/index.Vector4Lset(int index, java.nio.LongBuffer buffer)Read this vector from the suppliedLongBufferstarting at the specified absolute buffer position/index.Vector4Lset(long s)Set the x, y, z, and w components to the supplied value.Vector4Lset(long x, long y, long z, long w)Set the x, y, z, and w components to the supplied values.Vector4Lset(java.nio.ByteBuffer buffer)Read this vector from the suppliedByteBufferat the current bufferposition.Vector4Lset(java.nio.LongBuffer buffer)Read this vector from the suppliedLongBufferat the current bufferposition.Vector4Lset(Vector2ic v, long z, long w)Sets the first two components of this to the components of givenvand last two components to the givenz, andw.Vector4Lset(Vector3ic v, long w)Set the first three components of this to the components ofvand the last component tow.Vector4Lset(Vector4dc v)Set this vector to the values of v usingRoundingMode.TRUNCATErounding.Vector4Lset(Vector4dc v, int mode)Set this vector to the values of v using the givenRoundingMode.Vector4Lset(Vector4fc v, int mode)Set this vector to the values of v using the givenRoundingMode.Vector4Lset(Vector4ic v)Set this vector to the values of the givenv.Vector4Lset(Vector4Lc v)Set this vector to the values of the givenv.Vector4LsetComponent(int component, long value)Set the value of the specified component of this vector.Vector4LsetFromAddress(long address)Set the values of this vector by reading 4 integer values from off-heap memory, starting at the given address.Vector4Lsub(long x, long y, long z, long w)Subtract(x, y, z, w)from this.Vector4Lsub(long x, long y, long z, long w, Vector4L dest)Subtract(x, y, z, w)from this and store the result indest.Vector4Lsub(Vector4ic v)Subtract the supplied vector from this one.Vector4Lsub(Vector4ic v, Vector4L dest)Subtract the supplied vector from this one and store the result indest.Vector4Lsub(Vector4Lc v)Subtract the supplied vector from this one.Vector4Lsub(Vector4Lc v, Vector4L dest)Subtract the supplied vector from this one and store the result indest.java.lang.StringtoString()Return a string representation of this vector.java.lang.StringtoString(java.text.NumberFormat formatter)Return a string representation of this vector by formatting the vector components with the givenNumberFormat.longw()voidwriteExternal(java.io.ObjectOutput out)longx()Vector2dxy(Vector2d dest)Copy the(x, y)components ofthisinto the supplieddestvector and return it.Vector2fxy(Vector2f dest)Copy the(x, y)components ofthisinto the supplieddestvector and return it.Vector2Lxy(Vector2L dest)Copy the(x, y)components ofthisinto the supplieddestvector and return it.Vector3dxyz(Vector3d dest)Copy the(x, y, z)components ofthisinto the supplieddestvector and return it.Vector3fxyz(Vector3f dest)Copy the(x, y, z)components ofthisinto the supplieddestvector and return it.Vector3Lxyz(Vector3L dest)Copy the(x, y, z)components ofthisinto the supplieddestvector and return it.longy()longz()Vector4Lzero()Set all components to zero.
-
-
-
Constructor Detail
-
Vector4L
public Vector4L()
Create a newVector4Lof(0, 0, 0, 1).
-
Vector4L
public Vector4L(Vector4Lc v)
Create a newVector4Lwith the same values asv.- Parameters:
v- theVector4Lcto copy the values from
-
Vector4L
public Vector4L(Vector4ic v)
Create a newVector4Lwith the same values asv.- Parameters:
v- theVector4icto copy the values from
-
Vector4L
public Vector4L(Vector2Lc v, long z, long w)
- Parameters:
v- theVector2icz- the z componentw- the w component
-
Vector4L
public Vector4L(Vector2ic v, long z, long w)
- Parameters:
v- theVector2icz- the z componentw- the w component
-
Vector4L
public Vector4L(Vector3fc v, float w, int mode)
Create a newVector4Lwith the first three components from the givenvand the givenwand round using the givenRoundingMode.- Parameters:
v- theVector3fcto copy the values fromw- the w componentmode- theRoundingModeto use
-
Vector4L
public Vector4L(Vector4fc v, int mode)
Create a newVector4Land initialize its components to the rounded value of the given vector.- Parameters:
v- theVector4fcto round and copy the values frommode- theRoundingModeto use
-
Vector4L
public Vector4L(Vector4dc v, int mode)
Create a newVector4Land initialize its components to the rounded value of the given vector.- Parameters:
v- theVector4dcto round and copy the values frommode- theRoundingModeto use
-
Vector4L
public Vector4L(long s)
Create a newVector4Land initialize all four components with the given value.- Parameters:
s- scalar value of all four components
-
Vector4L
public Vector4L(long x, long y, long z, long w)Create a newVector4Lwith the given component values.- Parameters:
x- the x componenty- the y componentz- the z componentw- the w component
-
Vector4L
public Vector4L(int[] xyzw)
Create a newVector4Land initialize its four components from the first four elements of the given array.- Parameters:
xyzw- the array containing at least four elements
-
Vector4L
public Vector4L(java.nio.ByteBuffer buffer)
Create a newVector4Land 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
Vector4L(int, ByteBuffer), taking the absolute position as parameter.- Parameters:
buffer- values will be read inx, y, z, worder- See Also:
Vector4L(int, ByteBuffer)
-
Vector4L
public Vector4L(int index, java.nio.ByteBuffer buffer)Create a newVector4Land 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 ByteBufferbuffer- values will be read inx, y, z, worder
-
Vector4L
public Vector4L(java.nio.LongBuffer buffer)
Create a newVector4Land read this vector from the suppliedLongBufferat the current bufferposition.This method will not increment the position of the given LongBuffer.
In order to specify the offset into the LongBuffer at which the vector is read, use
Vector4L(int, LongBuffer), taking the absolute position as parameter.- Parameters:
buffer- values will be read inx, y, z, worder- See Also:
Vector4L(int, LongBuffer)
-
Vector4L
public Vector4L(int index, java.nio.LongBuffer buffer)Create a newVector4Land read this vector from the suppliedLongBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given LongBuffer.
- Parameters:
index- the absolute position into the LongBufferbuffer- values will be read inx, y, z, worder
-
-
Method Detail
-
xyz
public Vector3f xyz(Vector3f dest)
Copy the(x, y, z)components ofthisinto the supplieddestvector and return it.- Parameters:
dest- will hold the result- Returns:
- dest
-
xyz
public Vector3d xyz(Vector3d dest)
Copy the(x, y, z)components ofthisinto the supplieddestvector and return it.- Parameters:
dest- will hold the result- Returns:
- dest
-
xyz
public Vector3L xyz(Vector3L dest)
Copy the(x, y, z)components ofthisinto the supplieddestvector and return it.- Parameters:
dest- will hold the result- Returns:
- dest
-
xy
public Vector2f xy(Vector2f dest)
Copy the(x, y)components ofthisinto the supplieddestvector and return it.- Parameters:
dest- will hold the result- Returns:
- dest
-
xy
public Vector2d xy(Vector2d dest)
Copy the(x, y)components ofthisinto the supplieddestvector and return it.- Parameters:
dest- will hold the result- Returns:
- dest
-
xy
public Vector2L xy(Vector2L dest)
Copy the(x, y)components ofthisinto the supplieddestvector and return it.- Parameters:
dest- will hold the result- Returns:
- dest
-
set
public Vector4L set(Vector4Lc v)
Set this vector to the values of the givenv.- Parameters:
v- the vector whose values will be copied into this- Returns:
- this
-
set
public Vector4L set(Vector4ic v)
Set this vector to the values of the givenv.- Parameters:
v- the vector whose values will be copied into this- Returns:
- this
-
set
public Vector4L set(Vector4dc v)
Set this vector to the values of v usingRoundingMode.TRUNCATErounding.Note that due to the given vector
vstoring the components in double-precision, there is the possibility to lose precision.- Parameters:
v- the vector to copy from- Returns:
- this
-
set
public Vector4L set(Vector4dc v, int mode)
Set this vector to the values of v using the givenRoundingMode.Note that due to the given vector
vstoring the components in double-precision, there is the possibility to lose precision.- Parameters:
v- the vector to copy frommode- theRoundingModeto use- Returns:
- this
-
set
public Vector4L set(Vector4fc v, int mode)
Set this vector to the values of v using the givenRoundingMode.Note that due to the given vector
vstoring the components in double-precision, there is the possibility to lose precision.- Parameters:
v- the vector to copy frommode- theRoundingModeto use- Returns:
- this
-
set
public Vector4L set(Vector3ic v, long w)
Set the first three components of this to the components ofvand the last component tow.- Parameters:
v- theVector3icto copyw- the w component- Returns:
- this
-
set
public Vector4L set(Vector2ic v, long z, long w)
Sets the first two components of this to the components of givenvand last two components to the givenz, andw.- Parameters:
v- theVector2icz- the z componentw- the w component- Returns:
- this
-
set
public Vector4L set(long s)
Set the x, y, z, and w components to the supplied value.- Parameters:
s- the value of all four components- Returns:
- this
-
set
public Vector4L set(long x, long y, long z, long w)
Set the x, y, z, and w components to the supplied values.- Parameters:
x- the x componenty- the y componentz- the z componentw- the w component- Returns:
- this
-
set
public Vector4L set(int[] xyzw)
Set 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
-
set
public Vector4L set(java.nio.ByteBuffer buffer)
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
set(int, ByteBuffer), taking the absolute position as parameter.- Parameters:
buffer- values will be read inx, y, z, worder- Returns:
- this
- See Also:
set(int, ByteBuffer)
-
set
public Vector4L set(int index, java.nio.ByteBuffer buffer)
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 ByteBufferbuffer- values will be read inx, y, z, worder- Returns:
- this
-
set
public Vector4L set(java.nio.LongBuffer buffer)
Read this vector from the suppliedLongBufferat the current bufferposition.This method will not increment the position of the given LongBuffer.
In order to specify the offset into the LongBuffer at which the vector is read, use
set(int, LongBuffer), taking the absolute position as parameter.- Parameters:
buffer- values will be read inx, y, z, worder- Returns:
- this
- See Also:
set(int, LongBuffer)
-
set
public Vector4L set(int index, java.nio.LongBuffer buffer)
Read this vector from the suppliedLongBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given LongBuffer.
- Parameters:
index- the absolute position into the LongBufferbuffer- values will be read inx, y, z, worder- Returns:
- this
-
setFromAddress
public Vector4L setFromAddress(long address)
Set the values of this vector by reading 4 integer 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
-
get
public long get(int component) throws java.lang.IllegalArgumentExceptionDescription copied from interface:Vector4LcGet the value of the specified component of this vector.
-
maxComponent
public int maxComponent()
Description copied from interface:Vector4LcDetermine the component with the biggest absolute value.- Specified by:
maxComponentin interfaceVector4Lc- Returns:
- the component index, within
[0..3]
-
minComponent
public int minComponent()
Description copied from interface:Vector4LcDetermine the component with the smallest (towards zero) absolute value.- Specified by:
minComponentin interfaceVector4Lc- Returns:
- the component index, within
[0..3]
-
setComponent
public Vector4L setComponent(int component, long value) throws java.lang.IllegalArgumentException
Set 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:
java.lang.IllegalArgumentException- ifcomponentis not within[0..3]
-
get
public java.nio.LongBuffer get(java.nio.LongBuffer buffer)
Description copied from interface:Vector4LcStore this vector into the suppliedLongBufferat the current bufferposition.This method will not increment the position of the given LongBuffer.
In order to specify the offset into the LongBuffer at which the vector is stored, use
Vector4Lc.get(int, LongBuffer), taking the absolute position as parameter.- Specified by:
getin interfaceVector4Lc- Parameters:
buffer- will receive the values of this vector inx, y, z, worder- Returns:
- the passed in buffer
- See Also:
Vector4Lc.get(int, LongBuffer)
-
get
public java.nio.LongBuffer get(int index, java.nio.LongBuffer buffer)Description copied from interface:Vector4LcStore this vector into the suppliedLongBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given LongBuffer.
-
get
public java.nio.ByteBuffer get(java.nio.ByteBuffer buffer)
Description copied from interface:Vector4LcStore 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
Vector4Lc.get(int, ByteBuffer), taking the absolute position as parameter.- Specified by:
getin interfaceVector4Lc- Parameters:
buffer- will receive the values of this vector inx, y, z, worder- Returns:
- the passed in buffer
- See Also:
Vector4Lc.get(int, ByteBuffer)
-
get
public java.nio.ByteBuffer get(int index, java.nio.ByteBuffer buffer)Description copied from interface:Vector4LcStore this vector into the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
-
getToAddress
public Vector4Lc getToAddress(long address)
Description copied from interface:Vector4LcStore 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 interfaceVector4Lc- Parameters:
address- the off-heap address where to store this vector- Returns:
- this
-
sub
public Vector4L sub(Vector4Lc v)
Subtract the supplied vector from this one.- Parameters:
v- the vector to subtract- Returns:
- this
-
sub
public Vector4L sub(Vector4Lc v, Vector4L dest)
Description copied from interface:Vector4LcSubtract the supplied vector from this one and store the result indest.
-
sub
public Vector4L sub(Vector4ic v)
Subtract the supplied vector from this one.- Parameters:
v- the vector to subtract- Returns:
- this
-
sub
public Vector4L sub(Vector4ic v, Vector4L dest)
Description copied from interface:Vector4LcSubtract the supplied vector from this one and store the result indest.
-
sub
public Vector4L sub(long x, long y, long z, long w)
Subtract(x, y, z, w)from this.- Parameters:
x- the x component to subtracty- the y component to subtractz- the z component to subtractw- the w component to subtract- Returns:
- this
-
sub
public Vector4L sub(long x, long y, long z, long w, Vector4L dest)
Description copied from interface:Vector4LcSubtract(x, y, z, w)from this and store the result indest.
-
add
public Vector4L add(Vector4Lc v)
Add the supplied vector to this one.- Parameters:
v- the vector to add- Returns:
- this
-
add
public Vector4L add(Vector4Lc v, Vector4L dest)
Description copied from interface:Vector4LcAdd the supplied vector to this one and store the result indest.
-
add
public Vector4L add(Vector4ic v)
Add the supplied vector to this one.- Parameters:
v- the vector to add- Returns:
- this
-
add
public Vector4L add(Vector4ic v, Vector4L dest)
Description copied from interface:Vector4LcAdd the supplied vector to this one and store the result indest.
-
add
public Vector4L add(long x, long y, long z, long w)
Increment the components of this vector by the given values.- Parameters:
x- the x component to addy- the y component to addz- the z component to addw- the w component to add- Returns:
- this
-
add
public Vector4L add(long x, long y, long z, long w, Vector4L dest)
Description copied from interface:Vector4LcIncrement the components of this vector by the given values and store the result indest.
-
mul
public Vector4L mul(Vector4Lc v)
Multiply this Vector4L component-wise by another vector.- Parameters:
v- the other vector- Returns:
- this
-
mul
public Vector4L mul(Vector4Lc v, Vector4L dest)
Description copied from interface:Vector4LcMultiply this Vector4L component-wise by another Vector4Lc and store the result indest.
-
mul
public Vector4L mul(Vector4ic v)
Multiply this Vector4L component-wise by another vector.- Parameters:
v- the other vector- Returns:
- this
-
mul
public Vector4L mul(Vector4ic v, Vector4L dest)
Description copied from interface:Vector4LcMultiply this Vector4L component-wise by another Vector4ic and store the result indest.
-
div
public Vector4L div(Vector4Lc v)
Divide this Vector4L component-wise by another vector.- Parameters:
v- the vector to divide by- Returns:
- this
-
div
public Vector4L div(Vector4Lc v, Vector4L dest)
Description copied from interface:Vector4LcDivide this Vector4L component-wise by another Vector4Lc and store the result indest.
-
div
public Vector4L div(Vector4ic v)
Divide this Vector4L component-wise by another vector.- Parameters:
v- the vector to divide by- Returns:
- this
-
div
public Vector4L div(Vector4ic v, Vector4L dest)
Description copied from interface:Vector4LcDivide this Vector4L component-wise by another Vector4ic and store the result indest.
-
mul
public Vector4L mul(long scalar)
Multiply all components of this vector by the given scalar value.- Parameters:
scalar- the scalar to multiply by- Returns:
- this
-
mul
public Vector4L mul(long scalar, Vector4L dest)
Description copied from interface:Vector4LcMultiply all components of this vector by the given scalar value and store the result indest.
-
div
public Vector4L div(float scalar)
Divide all components of this vector by the given scalar value.- Parameters:
scalar- the scalar to divide by- Returns:
- this
-
div
public Vector4L div(float scalar, Vector4L dest)
Description copied from interface:Vector4LcDivide all components of this vector by the given scalar value and store the result indest.
-
div
public Vector4L div(long scalar)
Divide all components of this vector by the given scalar value.- Parameters:
scalar- the scalar to divide by- Returns:
- this
-
div
public Vector4L div(long scalar, Vector4L dest)
Description copied from interface:Vector4LcDivide all components of this vector by the given scalar value and store the result indest.
-
lengthSquared
public long lengthSquared()
Description copied from interface:Vector4LcReturn the length squared of this vector.- Specified by:
lengthSquaredin interfaceVector4Lc- Returns:
- the length squared
-
lengthSquared
public static long lengthSquared(long x, long y, long z, long w)Get the length squared of a 4-dimensional single-precision vector.- Parameters:
x- The vector's x componenty- The vector's y componentz- The vector's z componentw- The vector's w component- Returns:
- the length squared of the given vector
-
length
public double length()
Description copied from interface:Vector4LcReturn the length of this vector.
-
length
public static double length(long x, long y, long z, long w)Get the length of a 4-dimensional single-precision vector.- Parameters:
x- The vector's x componenty- The vector's y componentz- The vector's z componentw- The vector's w component- Returns:
- the length squared of the given vector
-
distance
public double distance(Vector4Lc v)
Description copied from interface:Vector4LcReturn the distance between this Vector andv.
-
distance
public double distance(Vector4ic v)
Description copied from interface:Vector4LcReturn the distance between this Vector andv.
-
distance
public double distance(long x, long y, long z, long w)Description copied from interface:Vector4LcReturn the distance betweenthisvector and(x, y, z, w).
-
gridDistance
public long gridDistance(Vector4Lc v)
Description copied from interface:Vector4LcReturn the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)(x, y).- Specified by:
gridDistancein interfaceVector4Lc- Parameters:
v- the other vector- Returns:
- the grid distance
-
gridDistance
public long gridDistance(Vector4ic v)
Description copied from interface:Vector4LcReturn the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)(x, y).- Specified by:
gridDistancein interfaceVector4Lc- Parameters:
v- the other vector- Returns:
- the grid distance
-
gridDistance
public long gridDistance(long x, long y, long z, long w)Description copied from interface:Vector4LcReturn the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)(x, y).- Specified by:
gridDistancein interfaceVector4Lc- Parameters:
x- 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 vector- Returns:
- the grid distance
-
distanceSquared
public long distanceSquared(Vector4Lc v)
Description copied from interface:Vector4LcReturn the square of the distance between this vector andv.- Specified by:
distanceSquaredin interfaceVector4Lc- Parameters:
v- the other vector- Returns:
- the squared of the distance
-
distanceSquared
public long distanceSquared(Vector4ic v)
Description copied from interface:Vector4LcReturn the square of the distance between this vector andv.- Specified by:
distanceSquaredin interfaceVector4Lc- Parameters:
v- the other vector- Returns:
- the squared of the distance
-
distanceSquared
public long distanceSquared(long x, long y, long z, long w)Description copied from interface:Vector4LcReturn the square of the distance betweenthisvector and(x, y, z, w).- Specified by:
distanceSquaredin interfaceVector4Lc- Parameters:
x- 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 vector- Returns:
- the square of the distance
-
distance
public static double distance(long x1, long y1, long z1, long w1, long x2, long y2, long z2, long w2)Return the distance between(x1, y1, z1, w1)and(x2, y2, z2, w2).- Parameters:
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 vector- Returns:
- the euclidean distance
-
distanceSquared
public static long distanceSquared(long x1, long y1, long z1, long w1, long x2, long y2, long z2, long w2)Return the squared distance between(x1, y1, z1, w1)and(x2, y2, z2, w2).- Parameters:
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 vector- Returns:
- the euclidean distance squared
-
dot
public long dot(Vector4Lc v)
Description copied from interface:Vector4LcCompute the dot product (inner product) of this vector andv.
-
dot
public long dot(Vector4ic v)
Description copied from interface:Vector4LcCompute the dot product (inner product) of this vector andv.
-
zero
public Vector4L zero()
Set all components to zero.- Returns:
- this
-
negate
public Vector4L negate()
Negate this vector.- Returns:
- this
-
negate
public Vector4L negate(Vector4L dest)
Description copied from interface:Vector4LcNegate this vector and store the result indest.
-
toString
public java.lang.String toString()
Return a string representation of this vector.This method creates a new
DecimalFormaton every invocation with the format string "0.000E0;-".- Overrides:
toStringin classjava.lang.Object- Returns:
- the string representation
-
toString
public java.lang.String toString(java.text.NumberFormat formatter)
Return a string representation of this vector by formatting the vector components with the givenNumberFormat.- Parameters:
formatter- theNumberFormatused to format the vector components with- Returns:
- the string representation
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
min
public Vector4L min(Vector4Lc v)
Set the components of this vector to be the component-wise minimum of this and the other vector.- Parameters:
v- the other vector- Returns:
- this
-
min
public Vector4L min(Vector4Lc v, Vector4L dest)
Description copied from interface:Vector4LcSet the components ofdestto be the component-wise minimum of this and the other vector.
-
max
public Vector4L max(Vector4Lc v)
Set the components of this vector to be the component-wise maximum of this and the other vector.- Parameters:
v- the other vector- Returns:
- this
-
max
public Vector4L max(Vector4Lc v, Vector4L dest)
Description copied from interface:Vector4LcSet the components ofdestto be the component-wise maximum of this and the other vector.
-
absolute
public Vector4L absolute()
Compute the absolute of each of this vector's components.- Returns:
- this
-
absolute
public Vector4L absolute(Vector4L dest)
Description copied from interface:Vector4LcCompute the absolute of each of this vector's components and store the result intodest.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
equals
public boolean equals(long x, long y, long z, long w)Description copied from interface:Vector4LcCompare the vector components ofthisvector with the given(x, y, z, w)and return whether all of them are equal.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-