Class PolarPoint

java.lang.Object
org.csstudio.swt.widgets.figureparts.PolarPoint

public class PolarPoint extends Object
A polar point in a standard polar coordinates system.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The radial coordinate
    double
    The angular coordinate in radians
  • Constructor Summary

    Constructors
    Constructor
    Description
    PolarPoint(int r, double theta)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    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
    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).
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • r

      public int r
      The radial coordinate
    • theta

      public double theta
      The angular coordinate in radians
  • Constructor Details

    • PolarPoint

      public PolarPoint(int r, double theta)
      Parameters:
      r - The radial coordinate
      theta - The angular coordinate in radians
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toPoint

      public org.eclipse.draw2d.geometry.Point toPoint()
      Transform the polar point to the Point 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 the Point 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 the 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.
      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 axis
      inRadians - true if the axisDirection is in radians, false if in degrees.
    • toString

      public String toString()
      Overrides:
      toString in class Object