pi
Class VecFloat

Object
  extended by pi.VecFloat

public class VecFloat
extends Object

A vector of three floats


Field Summary
 float x
           
 float y
           
 float z
           
static VecFloat ZERO
           
 
Method Summary
 VecFloat add(VecFloat v)
          Add
 float dot(VecFloat v)
          Scalar product
 float length()
          Length
 float lengthSq()
          length * length
 VecFloat mul(float s)
          Multiply with a float (scale)
 VecFloat neg()
          Negate (multiply with -1)
 VecFloat normalized()
          Get a vector in the same direction but with length 1
 VecFloat sub(VecFloat v)
          Subtract
 String toString()
           
static VecFloat xyz(float x, float y, float z)
          Create
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final VecFloat ZERO

x

public final float x

y

public final float y

z

public final float z
Method Detail

xyz

public static VecFloat xyz(float x,
                           float y,
                           float z)
Create


add

public VecFloat add(VecFloat v)
Add


sub

public VecFloat sub(VecFloat v)
Subtract


mul

public VecFloat mul(float s)
Multiply with a float (scale)


neg

public VecFloat neg()
Negate (multiply with -1)


dot

public float dot(VecFloat v)
Scalar product


normalized

public VecFloat normalized()
Get a vector in the same direction but with length 1


length

public float length()
Length


lengthSq

public float lengthSq()
length * length


toString

public final String toString()
Overrides:
toString in class Object