public class PolarPoint
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
r
The radial coordinate
|
double |
theta
The angular coordinate in radians
|
Constructor and Description |
---|
PolarPoint(int r,
double theta) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
static PolarPoint |
point2PolarPoint(org.eclipse.draw2d.geometry.Point pole,
org.eclipse.draw2d.geometry.Point point)
convert a point to polar point
|
void |
rotateAxis(double axisDirection,
boolean inRadians)
rotate the x axis of the polar coordinate system to the axisDirection
|
org.eclipse.draw2d.geometry.Point |
toAbsolutePoint(org.eclipse.draw2d.geometry.Rectangle rect)
Transform the polar point to the
Point in the absolute coordinate system. |
org.eclipse.draw2d.geometry.Point |
toPoint()
Transform the polar point to the
Point in rectangular coordinates. |
org.eclipse.draw2d.geometry.Point |
toRelativePoint(org.eclipse.draw2d.geometry.Rectangle rect)
Transform the polar point to the
Point in the relative coordinate system,
whose origin is (rect.x, rect.y). |
java.lang.String |
toString() |
public int r
public double theta
public PolarPoint(int r, double theta)
r
- The radial coordinatetheta
- The angular coordinate in radianspublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public org.eclipse.draw2d.geometry.Point toPoint()
Point
in rectangular coordinates.
The rectangular coordinates has the same origin as the polar coordinates.public org.eclipse.draw2d.geometry.Point toAbsolutePoint(org.eclipse.draw2d.geometry.Rectangle rect)
Point
in the absolute coordinate system.
It is assumed that the origin of the polar coordinate system is the central point of
the rectangle.rect
- the paint area of the figurepublic org.eclipse.draw2d.geometry.Point toRelativePoint(org.eclipse.draw2d.geometry.Rectangle rect)
Point
in the relative coordinate system,
whose origin is (rect.x, rect.y).
It is assumed that the origin of the polar coordinate system is the central point of
the rectangle.rect
- the paint area of the figurepublic static PolarPoint point2PolarPoint(org.eclipse.draw2d.geometry.Point pole, org.eclipse.draw2d.geometry.Point point)
pole
- the pole of the polar coordinate system.point
- the point to be convertedpublic void rotateAxis(double axisDirection, boolean inRadians)
axisDirection
- the direction of the new axisinRadians
- true if the axisDirection is in radians, false if in degrees.public java.lang.String toString()
toString
in class java.lang.Object