|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.gui.canvas.MathVector
Constructor Summary | |
MathVector(double x,
double y)
Create a vector with magnitude sqrt(x^2 + y^2) in the direction of (0,0) to (x,y) |
|
MathVector(java.awt.geom.Point2D first,
java.awt.geom.Point2D second)
Creates a vector in the direction of first to second, with magnitude equal to the distance between first and second |
Method Summary | |
static MathVector |
addVector(MathVector v1,
MathVector v2)
|
static java.awt.geom.Point2D |
addVectorToPoint(MathVector v,
java.awt.geom.Point2D pt)
Adds a vector to a point, to get a resulting point shifted by the vector |
static double |
computeAngle(MathVector v)
|
static double |
computeAngle(java.awt.geom.Point2D firstPoint,
java.awt.geom.Point2D secondPoint)
(firstPoint, secondPoint) define a line This computes the angle of the line relative to the x-axis |
static double |
computeHeight(MathVector vect,
double angle)
Computes the magnitude of vect perpendicular to direction of angle |
static MathVector |
computeHeightVector(MathVector vect,
double angle)
Computes component of vect perpendicular to direction of angle |
static MathVector |
computeUnitHeightVector(double angle)
Computes a unit vector perpendicular to direction of angle |
static MathVector |
computeUnitWidthVector(double angle)
Computes a unit vector in the direction of angle |
static double |
computeWidth(MathVector vect,
double angle)
Computes the magnitude of vect in the direction of angle |
static MathVector |
computeWidthVector(MathVector vect,
double angle)
Computes component of vect in direction of angle |
static double |
dotProduct(MathVector v1,
MathVector v2)
Computes the magnitude of the dot product |
double |
getLength()
Computes magnitude of vector |
double |
getX()
|
double |
getY()
|
static void |
main(java.lang.String[] args)
|
static java.awt.geom.Point2D |
offsetPointByHeight(java.awt.geom.Point2D refPt,
MathVector v,
double angle)
Offsets refPt in the direction of angle, with the magnitude of v projected on the angle |
static java.awt.geom.Point2D |
offsetPointByWidth(java.awt.geom.Point2D refPt,
MathVector v,
double angle)
We have a point which we want to move along the line with angle, "angle" v is a vector, which is projected onto angle, and tells us how much to move at an angle. |
static double |
projectUnit(MathVector vectSource,
MathVector vectProject)
Projects vectSource onto the normalized vectProject (i.e., a unit vector in the direction of vectProject) |
void |
setX(double xIn)
|
void |
setY(double yIn)
|
static java.awt.geom.Line2D |
testLineByWidth(java.awt.geom.Point2D refPt,
MathVector v,
double angle)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MathVector(double x, double y)
public MathVector(java.awt.geom.Point2D first, java.awt.geom.Point2D second)
first
- tail of the vectorsecond
- head of the vectorMethod Detail |
public double getX()
public void setX(double xIn)
public double getY()
public void setY(double yIn)
public double getLength()
public static double dotProduct(MathVector v1, MathVector v2)
v1
- The vector to be projectedv2
- The vector being projected on
public static double projectUnit(MathVector vectSource, MathVector vectProject)
vectSource
- The vector to be projectedvectProject
- The vector being projected on
public static double computeWidth(MathVector vect, double angle)
vect
- The vector to projectangle
- The angle of the unit vector to be projected on
public static double computeHeight(MathVector vect, double angle)
vect
- The vector to projectangle
- The angle of the unit vector to be projected on, in radians
public static MathVector computeUnitWidthVector(double angle)
angle
- In radians
public static MathVector computeUnitHeightVector(double angle)
angle
- In radians
public static MathVector computeWidthVector(MathVector vect, double angle)
vect
- The vector to be projectedangle
- The direction to be projected on, in radians
public static MathVector computeHeightVector(MathVector vect, double angle)
vect
- The vector to be projectedangle
- The direction to be projected on, in radians
public static MathVector addVector(MathVector v1, MathVector v2)
v1
- First vector to be addedv2
- Second vector to be added
public static java.awt.geom.Point2D addVectorToPoint(MathVector v, java.awt.geom.Point2D pt)
v
- To "add" to the pointpt
- The point to be added
public static java.awt.geom.Point2D offsetPointByWidth(java.awt.geom.Point2D refPt, MathVector v, double angle)
refPt
- The point to be offsetv
- The vector of movementangle
- The angle to project the vector on
public static java.awt.geom.Line2D testLineByWidth(java.awt.geom.Point2D refPt, MathVector v, double angle)
public static java.awt.geom.Point2D offsetPointByHeight(java.awt.geom.Point2D refPt, MathVector v, double angle)
refPt
- v
- angle
-
public static double computeAngle(java.awt.geom.Point2D firstPoint, java.awt.geom.Point2D secondPoint)
firstPoint
- secondPoint
-
public static double computeAngle(MathVector v)
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |