|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Vector
Constructor Summary | |
Vector()
Empty constructor |
|
Vector(double x,
double y)
Constructor with two parameters viz. |
|
Vector(double x1,
double y1,
double x2,
double y2)
Constructor with four parameters viz. |
Method Summary | |
Vector |
addVector(Vector operand)
Add two vectors |
double |
dotProduct(Vector operand)
Get dot product of two vectors |
double |
getMagnitude()
Get the magnitude |
Vector |
getNormal()
Get the normal vector |
double |
getX()
Get x component of the vector |
double |
getY()
Get y component of the vector |
boolean |
isEqual(Vector vec)
Check if the two vectors are equal in magnitude and return result |
Vector |
multiply(double k)
Multiply two vectors |
Vector |
rotateVector(double theta)
Rotate a vector by a given angle |
void |
setVector(Vector vec)
Set the x and y components of the vector |
void |
setX(double x)
Set x component of the vector |
void |
setY(double y)
Set y component of the vector |
Vector |
subtractVector(Vector operand)
Subtract two vectors |
Vector |
unitVector()
Get the unit vector of the given vector |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Vector()
public Vector(double x, double y)
public Vector(double x1, double y1, double x2, double y2)
Method Detail |
public void setVector(Vector vec)
public boolean isEqual(Vector vec)
public Vector addVector(Vector operand)
public Vector subtractVector(Vector operand)
public Vector multiply(double k)
public double dotProduct(Vector operand)
public double getX()
public void setX(double x)
public double getY()
public void setY(double y)
public Vector rotateVector(double theta)
public Vector getNormal()
public double getMagnitude()
public Vector unitVector()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |