Class Vector3d
- java.lang.Object
-
- org.scilab.forge.scirenderer.tranformations.Vector3d
-
public class Vector3d extends java.lang.Object- Author:
- Pierre Lando
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static doubledet(Vector3d v0, Vector3d v1, Vector3d v2)booleanequals(java.lang.Object obj)static Vector3dgetBarycenter(Vector3d v0, Vector3d v1, double w0, double w1)double[]getData()float[]getDataAsFloatArray()float[]getDataAsFloatArray(int size)doublegetNorm()doublegetNorm2()Vector3dgetNormalized()doublegetX()doublegetY()doublegetZ()inthashCode()booleanisNearZero()Return true if this vector is (0, 0, 0).booleanisZero()Return true if this vector is (0, 0, 0).Vector3dminus(Vector3d v)Vector3dplus(Vector3d v)static Vector3dproduct(Vector3d v1, Vector3d v2)Create a new vector cross-product of the given vectors.doublescalar(Vector3d v)Vector3dsetX(double x)Create a new vector, copy of this one, with a new X value.Vector3dsetY(double y)Create a new vector, copy of this one, with a new Y value.Vector3dsetZ(double z)Create a new vector, copy of this one, with a new Z value.Vector3dtimes(double d)java.lang.StringtoString()
-
-
-
Constructor Detail
-
Vector3d
public Vector3d(Vector3d v)
-
Vector3d
public Vector3d(double x, double y, double z)
-
Vector3d
public Vector3d(float[] position)
-
Vector3d
public Vector3d(double[] position)
-
Vector3d
public Vector3d(java.lang.Double[] position)
-
-
Method Detail
-
getX
public double getX()
-
getY
public double getY()
-
getZ
public double getZ()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getData
public double[] getData()
-
getDataAsFloatArray
public float[] getDataAsFloatArray()
-
getDataAsFloatArray
public float[] getDataAsFloatArray(int size)
-
times
public Vector3d times(double d)
-
getNormalized
public Vector3d getNormalized()
-
getNorm
public double getNorm()
-
getNorm2
public double getNorm2()
-
scalar
public double scalar(Vector3d v)
-
product
public static Vector3d product(Vector3d v1, Vector3d v2)
Create a new vector cross-product of the given vectors.- Parameters:
v1- the first given vector.v2- the second given vector.- Returns:
- a new vector cross-product of the given vectors.
-
getBarycenter
public static final Vector3d getBarycenter(Vector3d v0, Vector3d v1, double w0, double w1)
-
setX
public Vector3d setX(double x)
Create a new vector, copy of this one, with a new X value.- Parameters:
x- the new X value.- Returns:
- a new vector, copy of this one, with a new X value.
-
setY
public Vector3d setY(double y)
Create a new vector, copy of this one, with a new Y value.- Parameters:
y- the new Y value.- Returns:
- a new vector, copy of this one, with a new Y value.
-
setZ
public Vector3d setZ(double z)
Create a new vector, copy of this one, with a new Z value.- Parameters:
z- the new Z value.- Returns:
- a new vector, copy of this one, with a new Z value.
-
isZero
public boolean isZero()
Return true if this vector is (0, 0, 0).- Returns:
- true if this vector is (0, 0, 0).
-
isNearZero
public boolean isNearZero()
Return true if this vector is (0, 0, 0).- Returns:
- true if this vector is (0, 0, 0).
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-