net.java.dev.joode.util
Class Vector4

java.lang.Object
  extended by net.java.dev.joode.util.Real
      extended by net.java.dev.joode.util.Vector4
Direct Known Subclasses:
Quaternion

public class Vector4
extends Real

Author:
Tom Larkworthy

TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates


Field Summary
static Vector4 additionalConstraint
           
static Matrix4 linearHyperplaneCooeffecients
           
static Vector4 linearHyperplaneRHS
           
static Matrix4 modifiedNormals
           
static Matrix4 tmp
           
 
Fields inherited from class net.java.dev.joode.util.Real
m
 
Constructor Summary
Vector4()
           
Vector4(float x, float y, float z, float w)
           
 
Method Summary
 void add(float x, float y, float z, float w)
           
static Vector4 getLinearHyperPlaneNormal(Vector4 p1, Vector4 p2, Vector4 p3, Vector4 normal)
          returns the normal of a linear hyperplane (that is a 4D hyperplane passing through the origin) from three points.
 void set(float x, float y, float z, float w)
           
static Vector4 setRandomVector(Vector4 normal)
          sets the vector to be a posative random unit vector (should remove the forcing it to be unit)
 void sub(float x, float y, float z, float w)
           
 java.lang.String toString()
           
 
Methods inherited from class net.java.dev.joode.util.Real
add, aquireDirtyInstance, aquireInstance, dot, dot, epsilonEquals, epsilonEquals, fill, get, length, lengthSquared, max, min, norm, normalize, releaseInstance, scale, set, set, setZero, size, sub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modifiedNormals

public static final Matrix4 modifiedNormals

tmp

public static final Matrix4 tmp

linearHyperplaneCooeffecients

public static final Matrix4 linearHyperplaneCooeffecients

linearHyperplaneRHS

public static final Vector4 linearHyperplaneRHS

additionalConstraint

public static final Vector4 additionalConstraint
Constructor Detail

Vector4

public Vector4()

Vector4

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

set

public void set(float x,
                float y,
                float z,
                float w)

add

public void add(float x,
                float y,
                float z,
                float w)

sub

public void sub(float x,
                float y,
                float z,
                float w)

toString

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

getLinearHyperPlaneNormal

public static Vector4 getLinearHyperPlaneNormal(Vector4 p1,
                                                Vector4 p2,
                                                Vector4 p3,
                                                Vector4 normal)
returns the normal of a linear hyperplane (that is a 4D hyperplane passing through the origin) from three points. i.e. Ax1 + Bx2 + Cx3 + Dx4 = 0 deals with degeneracies, if the points are colinear though, and so no unique plane can be found then the method fills the passback with NaN

Parameters:
p1 -
p2 -
p3 -
normal -
See Also:
net.java.dev.joode.test.util.Vector4Test#testGetLinearHyperPlaneNormal();, ;, net.java.dev.joode.test.util.Vector4Test#testGetLinearHyperPlaneNormalDegenerate();

setRandomVector

public static Vector4 setRandomVector(Vector4 normal)
sets the vector to be a posative random unit vector (should remove the forcing it to be unit)

Parameters:
normal -
Returns: