|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectapps.lightrays.raytracer.scene.Vector
public class Vector
The Class Vector.
| Field Summary | |
|---|---|
static double |
EPSILON
The Constant EPSILON. |
double |
x
The x. |
double |
y
The y. |
double |
z
The z. |
| Constructor Summary | |
|---|---|
Vector()
Instantiates a new vector. |
|
Vector(double x,
double y,
double z)
Instantiates a new vector. |
|
Vector(Point p,
Point origin)
Instantiates a new vector. |
|
Vector(Vector v)
Instantiates a new vector. |
|
| Method Summary | |
|---|---|
void |
add(Vector v)
Adds the. |
Vector |
addNew(Vector v)
Adds the new. |
void |
crossProduct(Vector v)
Cross product. |
Vector |
crossProductNew(Vector v)
Cross product new. |
double |
dotproduct(Vector v)
Dotproduct. |
double |
length()
Length. |
Vector |
multiplyNew(double a)
Multiply new. |
boolean |
nonzero()
Nonzero. |
void |
normalise()
Normalise. |
void |
scale(double a)
Scale. |
void |
set(double x,
double y,
double z)
Sets the. |
void |
subtract(Vector v)
Subtract. |
Vector |
subtractNew(Vector v)
Subtract new. |
Point |
toPoint()
To point. |
java.lang.String |
toString()
|
void |
unaryMinus()
Unary minus. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double EPSILON
public double x
public double y
public double z
| Constructor Detail |
|---|
public Vector()
public Vector(double x,
double y,
double z)
x - the xy - the yz - the z
public Vector(Point p,
Point origin)
p - the porigin - the originpublic Vector(Vector v)
v - the v| Method Detail |
|---|
public void add(Vector v)
v - the vpublic Vector addNew(Vector v)
v - the v
public void crossProduct(Vector v)
v - the vpublic Vector crossProductNew(Vector v)
v - the v
public double dotproduct(Vector v)
v - the v
public double length()
public Vector multiplyNew(double a)
a - the a
public boolean nonzero()
public void normalise()
public void scale(double a)
a - the a
public void set(double x,
double y,
double z)
x - the xy - the yz - the zpublic void subtract(Vector v)
v - the vpublic Vector subtractNew(Vector v)
v - the v
public Point toPoint()
public java.lang.String toString()
toString in class java.lang.Objectpublic void unaryMinus()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||