Class Line2DPolar


  • public class Line2DPolar
    extends java.lang.Object
    Describes a line in 2D in polar coordinates.
    • Constructor Detail

      • Line2DPolar

        public Line2DPolar​(long cPtr,
                           boolean cMemoryOwn)
      • Line2DPolar

        public Line2DPolar​(double rho,
                           double theta)
        constructor

        rho * (cos(theta), sin(theta)) is the point on the line nearest to origo.

        Parameters:
        rho - [in] distance to the point on line which is closest to origo
        theta - [in] angle from x-axis up to the line that connects the origo and the
        point on the line that is closest to origo.
      • Line2DPolar

        public Line2DPolar​(double rho)
        constructor

        rho * (cos(theta), sin(theta)) is the point on the line nearest to origo.

        Parameters:
        rho - [in] distance to the point on line which is closest to origo
      • Line2DPolar

        public Line2DPolar()
        constructor

        rho * (cos(theta), sin(theta)) is the point on the line nearest to origo.


      • Line2DPolar

        public Line2DPolar​(Vector2Dd pnt,
                           double theta)
        constructor

        Parameters:
        pnt - [in] is any point on the line
        theta - [in] angle in radians from x-axis up to the line that connects the origo
        and the point on the line that is closest to origo.
      • Line2DPolar

        public Line2DPolar​(Vector2Dd start,
                           Vector2Dd end)
        constructor - The line moving through the segment from 'start' to 'end'.
        Parameters:
        start - [in] point on line
        end - [in] point on line
      • Line2DPolar

        public Line2DPolar​(Line2D line)
        constructor - The line moving through the line segment.
        Parameters:
        line - [in] the line described as a segment
    • Method Detail

      • getCPtr

        public static long getCPtr​(Line2DPolar obj)
      • delete

        public void delete()
      • getRho

        public double getRho()
        the shortest distance from origo the line
        Returns:
      • getTheta

        public double getTheta()
        angle in radians from x-axis up to the line that connects the origo and the
        point on the line that is closest to origo.
        Returns:
      • calcNormal

        public Vector2Dd calcNormal()
        get normal of line
      • dist2

        public double dist2​(Vector2Dd pnt)
        The L_2 distance from 'pnt' to the line.
      • projectionPoint

        public static Vector2Dd projectionPoint​(Line2DPolar line,
                                                Vector2Dd pnt)
        The point for the projection of 'pnt' onto 'line'.
      • linePoint

        public static Vector2Dd linePoint​(Line2DPolar line)
        A supporting point on the line (equal to rho * normal).
      • normalProjectionVector

        public static Vector2Dd normalProjectionVector​(Line2DPolar line,
                                                       Vector2Dd pnt)
        The vector for the projection of pnt onto the normal of line.
        Parameters:
        line - [in] a line.
        pnt - [in] a point.
        Returns:
        the projection vector.
      • lineToLocal

        public static Line2DPolar lineToLocal​(Pose2Dd pose,
                                              Line2DPolar line)
        line given relative to the coordinate frame of pose.
        Parameters:
        pose - [in] the pose.
        line - [in] the line.
        Returns:
        a Line2DPolar.