Class PolarPoint
java.lang.Object
org.eclipse.nebula.visualization.widgets.figureparts.PolarPoint
public class PolarPoint
extends java.lang.Object
A polar point in a standard polar coordinates system.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PolarPoint(int r, double theta)
-
Method Summary
Modifier and Type Method 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 pointvoid
rotateAxis(double axisDirection, boolean inRadians)
rotate the x axis of the polar coordinate system to the axisDirectionorg.eclipse.draw2d.geometry.Point
toAbsolutePoint(org.eclipse.draw2d.geometry.Rectangle rect)
Transform the polar point to thePoint
in the absolute coordinate system.org.eclipse.draw2d.geometry.Point
toPoint()
Transform the polar point to thePoint
in rectangular coordinates.org.eclipse.draw2d.geometry.Point
toRelativePoint(org.eclipse.draw2d.geometry.Rectangle rect)
Transform the polar point to thePoint
in the relative coordinate system, whose origin is (rect.x, rect.y).java.lang.String
toString()
-
Field Details
-
Constructor Details
-
PolarPoint
public PolarPoint(int r, double theta)- Parameters:
r
- The radial coordinatetheta
- The angular coordinate in radians
-
-
Method Details
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
toPoint
public org.eclipse.draw2d.geometry.Point toPoint()Transform the polar point to thePoint
in rectangular coordinates. The rectangular coordinates has the same origin as the polar coordinates.- Returns:
- the point in rectangular coordinates
-
toAbsolutePoint
public org.eclipse.draw2d.geometry.Point toAbsolutePoint(org.eclipse.draw2d.geometry.Rectangle rect)Transform the polar point to thePoint
in the absolute coordinate system. It is assumed that the origin of the polar coordinate system is the central point of the rectangle.- Parameters:
rect
- the paint area of the figure- Returns:
- the point in absolute coordinate system.
-
toRelativePoint
public org.eclipse.draw2d.geometry.Point toRelativePoint(org.eclipse.draw2d.geometry.Rectangle rect)Transform the polar point to thePoint
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.- Parameters:
rect
- the paint area of the figure- Returns:
- the point in relative coordinate system.
-
point2PolarPoint
public static PolarPoint point2PolarPoint(org.eclipse.draw2d.geometry.Point pole, org.eclipse.draw2d.geometry.Point point)convert a point to polar point- Parameters:
pole
- the pole of the polar coordinate system.point
- the point to be converted- Returns:
- the corresponding polar point.
-
rotateAxis
public void rotateAxis(double axisDirection, boolean inRadians)rotate the x axis of the polar coordinate system to the axisDirection- Parameters:
axisDirection
- the direction of the new axisinRadians
- true if the axisDirection is in radians, false if in degrees.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-