|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.miv.pherd.geom.Vector2
public class Vector2
| Field Summary | |
|---|---|
double[] |
data
Sequence of 3 coefficients. |
| Constructor Summary | |
|---|---|
Vector2()
New zero vector. |
|
Vector2(double x,
double y)
New ( x,y) vector. |
|
Vector2(Point2 point)
New vector copy of point. |
|
Vector2(Vector2 other)
New vector copy of other. |
|
| Method Summary | |
|---|---|
void |
add(Vector2 other)
Add each element of other to the corresponding element of this. |
double |
at(int i)
i-th element. |
Object |
clone()
|
void |
copy(Point2 point)
Make this a copy of point. |
void |
copy(Vector2 other)
Make this a copy of other. |
double |
dotProduct(Vector2 other)
Dot product of this and other. |
boolean |
equals(Object other)
Is this equal to other ? |
boolean |
equals(Vector2 other)
Is this equal to other ? |
void |
fill(double value)
Assign value to all elements. |
boolean |
isZero()
Are all components to zero?. |
double |
length()
Cartesian length. |
void |
mult(Vector2 other)
Multiply each element of this by the corresponding element of other. |
double |
normalize()
Transform this into an unit vector. |
void |
scalarAdd(double value)
Add value to each element. |
void |
scalarDiv(double value)
Divide each element by value. |
void |
scalarMult(double value)
Multiply each element by value. |
void |
scalarSub(double value)
Substract value to each element. |
void |
set(double x,
double y)
Explicitly set the three components. |
void |
set(int i,
double value)
Explicitly set the i-th component to value. |
void |
sub(Vector2 other)
Substract each element of other to the corresponding element of this. |
String |
toString()
|
boolean |
validComponent(int i)
Is i the index of a component ? |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double[] data
| Constructor Detail |
|---|
public Vector2()
public Vector2(double x,
double y)
x,y) vector.
public Vector2(Vector2 other)
other.
public Vector2(Point2 point)
point.
| Method Detail |
|---|
public boolean isZero()
public boolean equals(Object other)
equals in class Objectpublic boolean equals(Vector2 other)
public boolean validComponent(int i)
public double at(int i)
public Object clone()
clone in class Objectpublic double dotProduct(Vector2 other)
public double length()
public void fill(double value)
public void set(int i,
double value)
public void set(double x,
double y)
public void add(Vector2 other)
public void sub(Vector2 other)
public void mult(Vector2 other)
public void scalarAdd(double value)
public void scalarSub(double value)
public void scalarMult(double value)
public void scalarDiv(double value)
public double normalize()
public void copy(Vector2 other)
public void copy(Point2 point)
point.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||