de.enough.polish.graphics3d.linalg
Class Vec4Df

java.lang.Object
  extended by de.enough.polish.graphics3d.linalg.Vec4Df

public class Vec4Df
extends Object

A 4 dimensional Vector implementation. Class using floating point precision.

Author:
Anders Bo Pedersen, anders@wicore.dk

Field Summary
 float wf
           
 float xf
           
 float yf
           
 float zf
           
 
Constructor Summary
Vec4Df()
           
Vec4Df(float xf, float yf, float zf, float wf)
           
Vec4Df(Vec4Df other)
           
 
Method Summary
 void add(Vec4Df other)
           
 float dot(Vec4Df other)
           
 boolean equals(Vec4Df other)
           
 void invert()
           
 float length()
          Euclidean length of vector
 void normalize()
          Normalize the vector to unit length
 Vec3Df project()
          Projects 4D vector
 String propertiesToString()
           
 void scale(float factorx)
           
 Vec4Df scaleNew(float factorx)
           
 void sub(Vec4Df other)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xf

public volatile float xf

yf

public volatile float yf

zf

public volatile float zf

wf

public volatile float wf
Constructor Detail

Vec4Df

public Vec4Df()

Vec4Df

public Vec4Df(float xf,
              float yf,
              float zf,
              float wf)

Vec4Df

public Vec4Df(Vec4Df other)
Method Detail

add

public void add(Vec4Df other)

sub

public void sub(Vec4Df other)

invert

public void invert()

scale

public void scale(float factorx)

scaleNew

public Vec4Df scaleNew(float factorx)

dot

public float dot(Vec4Df other)

equals

public boolean equals(Vec4Df other)

length

public float length()
Euclidean length of vector

Returns:
the length

normalize

public void normalize()
Normalize the vector to unit length


project

public Vec3Df project()
Projects 4D vector


propertiesToString

public String propertiesToString()