Class PolarPoint
- java.lang.Object
-
- org.eclipse.nebula.visualization.widgets.figureparts.PolarPoint
-
public class PolarPoint extends java.lang.ObjectA polar point in a standard polar coordinates system.
-
-
Constructor Summary
Constructors Constructor Description PolarPoint(int r, double theta)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()static PolarPointpoint2PolarPoint(org.eclipse.draw2d.geometry.Point pole, org.eclipse.draw2d.geometry.Point point)convert a point to polar pointvoidrotateAxis(double axisDirection, boolean inRadians)rotate the x axis of the polar coordinate system to the axisDirectionorg.eclipse.draw2d.geometry.PointtoAbsolutePoint(org.eclipse.draw2d.geometry.Rectangle rect)Transform the polar point to thePointin the absolute coordinate system.org.eclipse.draw2d.geometry.PointtoPoint()Transform the polar point to thePointin rectangular coordinates.org.eclipse.draw2d.geometry.PointtoRelativePoint(org.eclipse.draw2d.geometry.Rectangle rect)Transform the polar point to thePointin the relative coordinate system, whose origin is (rect.x, rect.y).java.lang.StringtoString()
-
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toPoint
public org.eclipse.draw2d.geometry.Point toPoint()
Transform the polar point to thePointin 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 thePointin 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 thePointin 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:
toStringin classjava.lang.Object
-
-