|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ProGAL.geomNd.Vector ProGAL.geom2d.Vector
public class Vector
Constructor Summary | |
---|---|
Vector(double[] coords)
|
|
Vector(double x,
double y)
|
|
Vector(Point p,
Point q)
|
Method Summary | |
---|---|
Vector |
add(Vector v)
|
Vector |
addThis(Point p)
|
Vector |
addThis(Vector v)
|
Vector |
clone()
Create a clone of this vector. |
static Vector |
createDiff(Vector u,
Vector v)
|
Vector |
createRotatedVector(double a)
|
static Vector |
createSum(Vector u,
Vector v)
|
static double |
crossProduct(Vector u,
Vector v)
|
double |
dot(Vector v)
|
static double |
dotProduct(Vector u,
Vector v)
|
double[] |
getCoords()
|
double |
getSlope()
|
double |
getSquaredLength()
|
static boolean |
leftTurn(Vector u,
Vector v)
|
double |
length()
Get the length of this vector. |
Vector |
multiply(double a)
Multiply this vector by s and return the result (without changing this object). |
Vector |
multiplyThis(double a)
Multiply this vector by s and return the result (changing this object). |
void |
negative()
|
Vector |
normalize()
Normalize this vector and return the result (without changing this object). |
Vector |
normalizeThis()
Normalize this vector and return the result (changing this object). |
static boolean |
rightTurn(Vector u,
Vector v)
|
Vector |
rotate90()
|
Vector |
rotate90This()
|
Vector |
rotateThis(double a)
|
Vector |
scale(double a)
|
Vector |
scaleToLength(double l)
Scale this vector to a certain length (returns new object and does not change this object). |
void |
toConsole()
Writes this vector to System.out . |
void |
toConsole(int dec)
Writes this vector to System.out with dec decimals precision. |
Point |
toPoint()
Convert this vector to a point. |
java.lang.String |
toString()
Returns a string-representation of this vector formatted with two decimals precision. |
java.lang.String |
toString(int dec)
Returns a string-representation of this vector formatted with dec decimals precision. |
double |
x()
|
double |
y()
|
Methods inherited from class ProGAL.geomNd.Vector |
---|
add, addThis, angle, divide, divideThis, dot, equals, equals, get, getAngle, getCoord, getDimensions, getLengthSquared, isZeroVector, outerProduct, scaleToLengthThis, set, setCoord, setCoords, subtract, subtractThis |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Vector(double x, double y)
public Vector(double[] coords)
public Vector(Point p, Point q)
Method Detail |
---|
public double x()
public double y()
public double[] getCoords()
public double getSquaredLength()
public double length()
Vector
length
in class Vector
public double getSlope()
public void negative()
public Vector scale(double a)
public Vector rotateThis(double a)
public Vector add(Vector v)
public Vector addThis(Vector v)
public Vector addThis(Point p)
public Vector multiply(double a)
Vector
multiply
in class Vector
public Vector multiplyThis(double a)
Vector
multiplyThis
in class Vector
public Vector normalize()
Vector
normalize
in class Vector
public Vector normalizeThis()
Vector
normalizeThis
in class Vector
public Vector createRotatedVector(double a)
public Vector rotate90()
public Vector rotate90This()
public Point toPoint()
Vector
toPoint
in class Vector
public static Vector createSum(Vector u, Vector v)
public static Vector createDiff(Vector u, Vector v)
public static double crossProduct(Vector u, Vector v)
public static double dotProduct(Vector u, Vector v)
public static boolean leftTurn(Vector u, Vector v)
public static boolean rightTurn(Vector u, Vector v)
public java.lang.String toString()
Vector
toString
in class Vector
public java.lang.String toString(int dec)
Vector
dec
decimals precision.
toString
in class Vector
public void toConsole()
Vector
System.out
.
toConsole
in class Vector
public void toConsole(int dec)
Vector
System.out
with dec
decimals precision.
toConsole
in class Vector
public Vector scaleToLength(double l)
Vector
scaleToLength
in class Vector
public double dot(Vector v)
public Vector clone()
Vector
clone
in class Vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |