|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.geom.Point2D
java.awt.geom.Point2D.Float
lejos.geom.Point
public class Point
Point with float co-ordinates for use in navigation. This class includes methods allow it to behave as a vector in 2 dimensional vector space. It includes the standard vector arithmetic operatins of addition, * subtraction, scalar multiplication, and inner product.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Point2D |
|---|
Point2D.Double, Point2D.Float |
| Field Summary |
|---|
| Fields inherited from class java.awt.geom.Point2D.Float |
|---|
x, y |
| Constructor Summary | |
|---|---|
Point(float radians)
Returns a point ad distance 1 from the origin and an angle radans to the x-axis |
|
Point(float x,
float y)
returns a Point at location x,y |
|
| Method Summary | |
|---|---|
Point |
add(Point other)
Returns the vector sum of this and other |
Point |
addWith(Point other)
Vector addition; add other to this |
float |
angle()
returns the angle in radians of this point from the origin. |
float |
angleTo(Point p)
Returns the direction angle from this point to the Point p |
Point |
clone()
returns a clone of itself |
Point |
copyTo(Point p)
|
float |
dotProduct(Point other)
Returns the inner dot product. |
Point |
getNormalized()
get a copy of this with length 1 |
Point |
leftOrth()
calculate left orthogonal vector of this |
float |
length()
Returns the length of this vector |
Point |
makeLeftOrth()
Turns this vector into its left-handed cartesian orthagonal |
Point |
makeRightOrth()
Turns this vector into its right-handed cartesian orthagonal |
void |
moveTo(Point other)
Makes this a copy of the other point |
Point |
multiply(float scale)
Scalar multiplication |
Point |
multiplyBy(float scale)
scalar multiplication |
Point |
normalize()
Sets this vector's length to 1 unit while retaining direction |
Point |
pointAt(float distance,
float angle)
Returns a new point at the specified distance in the direction angle from this point. |
Point |
projectOn(Line line)
Finds the orthogonal projection of this point onto the line. |
Point |
reverse()
same as multiply(-1); |
Point |
rightOrth()
calculate the right handed cartesian orthogonal of this poiont |
Point |
subtract(float length)
Vector subtraction |
Point |
subtract(Point other)
Vector subtraction |
Point |
subtractWith(Point other)
vector subtraction |
void |
translate(float dx,
float dy)
Translates this point, at location (x, y), by dx along the x axis and dy along the y axis so that it now represents the point (x + dx, y + dy). |
| Methods inherited from class java.awt.geom.Point2D.Float |
|---|
getX, getY, setLocation, setLocation, toString |
| Methods inherited from class java.awt.geom.Point2D |
|---|
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, setLocation |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Point(float x,
float y)
x - coordinatey - coordinatepublic Point(float radians)
radans to the x-axis
radians - | Method Detail |
|---|
public float angleTo(Point p)
p - the Point to determine the angle to
public void translate(float dx,
float dy)
dx - dy - public Point copyTo(Point p)
public Point clone()
clone in class Point2Dpublic Point add(Point other)
this and other
other - the point added to this
public Point addWith(Point other)
this
other - is added to this
this after the additionpublic void moveTo(Point other)
this a copy of the other point
other - public Point subtract(Point other)
other - is subtracted from this
public Point subtract(float length)
length - of a copy of this
public Point multiply(float scale)
scale - multilies the length of this to give a new length
public Point getNormalized()
this with length 1
public Point reverse()
public Point projectOn(Line line)
line - onto which the projection is made
public float angle()
public Point leftOrth()
this
public Point rightOrth()
public Point subtractWith(Point other)
other - is subtracted from this
public Point multiplyBy(float scale)
scale -
public float length()
public Point normalize()
public Point makeLeftOrth()
public Point makeRightOrth()
public float dotProduct(Point other)
public Point pointAt(float distance,
float angle)
distance - the distance to the new pointangle - the angle to the new point
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||