Class PolarPoint
java.lang.Object
org.csstudio.swt.widgets.figureparts.PolarPoint
A polar point in a standard polar coordinates system.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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).toString()
-
Field Details
-
r
public int rThe radial coordinate -
theta
public double thetaThe angular coordinate in radians
-
-
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() -
equals
-
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
-