|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--raytracer.internal.Vector
A vector in three dimensions
Constructor Summary | |
Vector(float x,
float y,
float z)
Creates the vector (x,y,z) |
Method Summary | |
Vector |
crossProduct(Vector v)
Calculates the vector cross product |
float |
dotProduct(Vector v)
Calculates the vector dot product |
Vector |
invert()
Inverts a vector componentwise |
float |
length()
Calculates the length of the vector |
Vector |
normalize()
Scales the vector such that the length equals one |
Vector |
reflect(Vector normal)
Reflects a vector at a plane with the given normal |
Vector |
scale(float t)
Scales the vector by the given factor |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Vector(float x, float y, float z)
Method Detail |
public float length()
public Vector normalize()
public Vector scale(float t)
t
- Scaling factor
public float dotProduct(Vector v)
v
- Vector for multiplication
public Vector crossProduct(Vector v)
v
- Vector for multiplication
public Vector invert()
public Vector reflect(Vector normal)
normal
- Normal vector of the plane to reflect at
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |