gnu.util
Class Vector3f

java.lang.Object
  extended by gnu.util.Vector3f

public class Vector3f
extends java.lang.Object

3-element vector of float in mathematics.


Field Summary
 float[] v
           
static Vector3f ZERO
           
 
Constructor Summary
Vector3f()
           
Vector3f(float[] v)
           
Vector3f(float x, float y, float z, float w)
           
 
Method Summary
static float[] cross(float[] A, float[] B, float[] C)
          C = A x B.
 Vector3f cross(Vector3f A, Vector3f B)
           
 float length_square()
           
static float length_square(float[] A)
          |A| = x*x + y*y + z*z.
 float length()
           
static float length(float[] A)
           
static float[] minus(float[] A, float[] B, float[] C)
          C = A - B.
 Vector3f minus(Vector3f A, Vector3f B)
           
 Vector3f negate()
           
static float[] negate(float[] A, float[] B)
          B = -A.
 Vector3f negate(Vector3f A)
           
 Vector3f normalize()
           
static float[] normalize(float[] A, float[] B)
          B = A / |A|.
 Vector3f normalize(Vector3f A)
           
static float[] scalar_addition(float[] A, float d, float[] B)
          B = A + (a * I).
 Vector3f scalar_divide(float d)
           
static float[] scalar_divide(float[] A, float d, float[] B)
          B = (1/d) * A.
 Vector3f scalar_divide(Vector3f A, float d)
           
 Vector3f scalar_minus(float d)
           
static float[] scalar_minus(float[] A, float d, float[] B)
          B = A - (a * I).
 Vector3f scalar_minus(Vector3f A, float d)
           
 Vector3f scalar_multiply(float d)
           
static float[] scalar_multiply(float[] A, float d, float[] B)
          B = d * A.
 Vector3f scalar_multiply(Vector3f A, float d)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Vector3f ZERO

v

public float[] v
Constructor Detail

Vector3f

public Vector3f()

Vector3f

public Vector3f(float[] v)

Vector3f

public Vector3f(float x,
                float y,
                float z,
                float w)
Method Detail

cross

public static float[] cross(float[] A,
                            float[] B,
                            float[] C)
C = A x B.


cross

public Vector3f cross(Vector3f A,
                      Vector3f B)

length

public float length()

length

public static float length(float[] A)

length_square

public float length_square()

length_square

public static float length_square(float[] A)
|A| = x*x + y*y + z*z.


minus

public Vector3f minus(Vector3f A,
                      Vector3f B)

minus

public static float[] minus(float[] A,
                            float[] B,
                            float[] C)
C = A - B.


negate

public Vector3f negate()

negate

public Vector3f negate(Vector3f A)

negate

public static float[] negate(float[] A,
                             float[] B)
B = -A.


normalize

public Vector3f normalize()

normalize

public Vector3f normalize(Vector3f A)

normalize

public static float[] normalize(float[] A,
                                float[] B)
B = A / |A|.


scalar_addition

public static float[] scalar_addition(float[] A,
                                      float d,
                                      float[] B)
B = A + (a * I).


scalar_divide

public Vector3f scalar_divide(float d)

scalar_divide

public Vector3f scalar_divide(Vector3f A,
                              float d)

scalar_divide

public static float[] scalar_divide(float[] A,
                                    float d,
                                    float[] B)
B = (1/d) * A.


scalar_minus

public Vector3f scalar_minus(float d)

scalar_minus

public Vector3f scalar_minus(Vector3f A,
                             float d)

scalar_minus

public static float[] scalar_minus(float[] A,
                                   float d,
                                   float[] B)
B = A - (a * I).


scalar_multiply

public Vector3f scalar_multiply(float d)

scalar_multiply

public Vector3f scalar_multiply(Vector3f A,
                                float d)

scalar_multiply

public static float[] scalar_multiply(float[] A,
                                      float d,
                                      float[] B)
B = d * A.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object