|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.xml.ElementState
ecologylab.xml.library.geom.SpatialVector
ecologylab.xml.library.geom.Vector2d
public class Vector2d
| Nested Class Summary |
|---|
| Field Summary |
|---|
| Fields inherited from class ecologylab.xml.ElementState |
|---|
CDATA, NORMAL, UTF16, UTF16_LE, UTF8 |
| Fields inherited from interface ecologylab.xml.XMLTranslationExceptionTypes |
|---|
FILE_NOT_FOUND, IO_EXCEPTION, NULL_PURL, UNKNOWN |
| Constructor Summary | |
|---|---|
Vector2d()
|
|
Vector2d(double x,
double y)
|
|
Vector2d(Vector2d otherVect)
|
|
| Method Summary | |
|---|---|
void |
add(Vector2d v)
|
static Vector2d |
add(Vector2d v1,
Vector2d v2)
Adds two vectors together and returns a new Vector2d object representing the sum. |
Vector2d |
clone()
|
static double |
dot(Vector2d v1,
Vector2d v2)
Determines the dot product of two vector objects. |
double |
getX()
|
double |
getY()
|
void |
mult(double scalar)
|
double |
norm()
|
void |
rotate(double angle)
Rotates this vector around the origin by the specified angle in degrees. |
void |
rotateTo(double angle)
Rotates this vector so that it is aligned to the specified angle in radians. |
static Vector2d |
scalarMultiply(Vector2d vector,
double scalar)
Multiplies a vector by a scalar value and returns a new Vector2d representing the result. |
void |
set(double x,
double y)
|
void |
set(Vector2d pos)
|
void |
setNorm(double mag)
Adjusts the magnitude of this vector to match mag. |
void |
setX(double x)
|
void |
setY(double y)
|
static Vector2d |
sub(SpatialVector v1,
SpatialVector v2)
Subtracts v2 from v1 and returns a new Vector2d representing the result. |
void |
sub(Vector2d v)
|
java.awt.geom.Point2D |
toPoint()
|
double |
toRadians()
Converts the vector into a radian angle. |
java.lang.String |
toString()
|
void |
unitize()
|
Vector2d |
unitVector()
|
void |
zero()
|
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Vector2d()
public Vector2d(double x,
double y)
public Vector2d(Vector2d otherVect)
| Method Detail |
|---|
public static Vector2d add(Vector2d v1,
Vector2d v2)
v1 - v2 -
public static Vector2d scalarMultiply(Vector2d vector,
double scalar)
vector - scalar -
public static double dot(Vector2d v1,
Vector2d v2)
v1 - v2 -
public static Vector2d sub(SpatialVector v1,
SpatialVector v2)
v1 - v2 -
public void add(Vector2d v)
public double norm()
public void mult(double scalar)
public void rotate(double angle)
angle - -
in radianspublic void rotateTo(double angle)
angle - -
in radianspublic void sub(Vector2d v)
public double toRadians()
public Vector2d unitVector()
public void unitize()
public Vector2d clone()
clone in class java.lang.ObjectObject.clone()public void set(Vector2d pos)
public java.awt.geom.Point2D toPoint()
toPoint in class SpatialVectorpublic java.lang.String toString()
toString in class DebugDebug.toString()public void setNorm(double mag)
mag - public void zero()
public void set(double x,
double y)
public void setX(double x)
y - the y to setpublic void setY(double y)
y - the y to setpublic double getX()
getX in class SpatialVectorpublic double getY()
getY in class SpatialVector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||