|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectquentinc.geom.Vector
public class Vector
Class for manipulating 3D vectors.
| Constructor Summary | |
|---|---|
Vector()
Default constructor. |
|
Vector(double x,
double y)
_Create a new vector with given x and y, and z=0 |
|
Vector(double x,
double y,
double z)
Create a new vector with given components |
|
| Method Summary | |
|---|---|
Vector |
add(double x,
double y,
double z)
Add values to each component |
Vector |
add(Vector v)
Add the vector given to this one |
Vector |
clone()
|
Vector |
crossProduct(Vector v)
Return the cross product of this vector and the one given |
Vector |
divide(double f)
Divide the vector by a scalar value |
boolean |
equals(java.lang.Object o)
|
double |
getLength()
Get the vector's length, as known as norma. |
double |
getX()
Get X component |
double |
getY()
Get Y component |
double |
getZ()
Get Z component |
int |
hashCode()
|
Vector |
linearTransform(Matrix m)
Multiply this vector with the given 3x3 matrix. |
Vector |
multiply(double f)
Multiply the vector by a scalar value |
void |
normalize()
Normalize the vector so that it has a length of 1 |
double |
scalarProduct(Vector v)
Return the scalar product (as known as dot product) of this vector and the one given. |
void |
set(double x,
double y,
double z)
Set all the components in one call |
void |
setX(double a)
Set X component |
void |
setY(double a)
Set Y component |
void |
setZ(double a)
set Z component |
Vector |
subtract(double x,
double y,
double z)
Subtract the given vector to this one |
Vector |
subtract(Vector v)
Subtract the given vector to this one |
java.lang.String |
toString()
Return a String representation of this vector (i.e. "1;2;3") |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Vector()
public Vector(double x,
double y)
public Vector(double x,
double y,
double z)
| Method Detail |
|---|
public double getX()
public double getY()
public double getZ()
public void setX(double a)
public void setY(double a)
public void setZ(double a)
public double getLength()
public void normalize()
public Vector divide(double f)
public Vector multiply(double f)
public void set(double x,
double y,
double z)
public Vector add(double x,
double y,
double z)
public Vector add(Vector v)
public Vector subtract(double x,
double y,
double z)
public Vector subtract(Vector v)
public double scalarProduct(Vector v)
public Vector crossProduct(Vector v)
public Vector linearTransform(Matrix m)
public java.lang.String toString()
toString in class java.lang.Objectpublic Vector clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||