org.scilab.forge.scirenderer.tranformations
Class Vector3d

java.lang.Object
  extended by org.scilab.forge.scirenderer.tranformations.Vector3d

public class Vector3d
extends java.lang.Object

Author:
Pierre Lando

Constructor Summary
Vector3d(double[] position)
           
Vector3d(java.lang.Double[] position)
           
Vector3d(double x, double y, double z)
           
Vector3d(float[] position)
           
Vector3d(Vector3d v)
           
 
Method Summary
static double det(Vector3d v0, Vector3d v1, Vector3d v2)
           
 boolean equals(java.lang.Object obj)
           
static Vector3d getBarycenter(Vector3d v0, Vector3d v1, double w0, double w1)
           
 double[] getData()
           
 float[] getDataAsFloatArray()
           
 float[] getDataAsFloatArray(int size)
           
 double getNorm()
           
 double getNorm2()
           
 Vector3d getNormalized()
           
 double getX()
           
 double getY()
           
 double getZ()
           
 int hashCode()
           
 boolean isNearZero()
          Return true if this vector is (0, 0, 0).
 boolean isZero()
          Return true if this vector is (0, 0, 0).
 Vector3d minus(Vector3d v)
           
 Vector3d plus(Vector3d v)
           
static Vector3d product(Vector3d v1, Vector3d v2)
          Create a new vector cross-product of the given vectors.
 double scalar(Vector3d v)
           
 Vector3d setX(double x)
          Create a new vector, copy of this one, with a new X value.
 Vector3d setY(double y)
          Create a new vector, copy of this one, with a new Y value.
 Vector3d setZ(double z)
          Create a new vector, copy of this one, with a new Z value.
 Vector3d times(double d)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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:
toString in class java.lang.Object

getData

public double[] getData()

getDataAsFloatArray

public float[] getDataAsFloatArray()

getDataAsFloatArray

public float[] getDataAsFloatArray(int size)

plus

public Vector3d plus(Vector3d v)

minus

public Vector3d minus(Vector3d v)

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.

det

public static final double det(Vector3d v0,
                               Vector3d v1,
                               Vector3d v2)

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:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object