## Class Line2DPolar

• java.lang.Object
• org.robwork.sdurw_math.Line2DPolar

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

Constructors
Constructor Description
`Line2DPolar()`
constructor

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

`Line2DPolar​(double rho)`
constructor

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

```Line2DPolar​(double rho, double theta)```
constructor

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

```Line2DPolar​(long cPtr, boolean cMemoryOwn)```
`Line2DPolar​(Line2D line)`
constructor - The line moving through the line segment.
```Line2DPolar​(Vector2D pnt, double theta)```
constructor

```Line2DPolar​(Vector2D start, Vector2D end)```
constructor - The line moving through the segment from 'start' to 'end'.
• ### Method Summary

All Methods
Modifier and Type Method Description
`Vector2D` `calcNormal()`
get normal of line
`void` `delete()`
`double` `dist2​(Vector2D pnt)`
The L_2 distance from 'pnt' to the line.
`static long` `getCPtr​(Line2DPolar obj)`
`double` `getRho()`
the shortest distance from origo the line
`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.
`static Vector2D` `linePoint​(Line2DPolar line)`
A supporting point on the line (equal to rho * normal).
`static Line2DPolar` ```lineToLocal​(Pose2D pose, Line2DPolar line)```
line given relative to the coordinate frame of pose.
`static Vector2D` ```normalProjectionVector​(Line2DPolar line, Vector2D pnt)```
The vector for the projection of pnt onto the normal of line.
`static Vector2D` ```projectionPoint​(Line2DPolar line, Vector2D pnt)```
The point for the projection of 'pnt' onto 'line'.
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### 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​(Vector2D 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​(Vector2D start,
Vector2D 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 Vector2D calcNormal()`
get normal of line
• #### dist2

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

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

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

```public static Vector2D normalProjectionVector​(Line2DPolar line,
Vector2D 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​(Pose2D pose,
Line2DPolar line)```
line given relative to the coordinate frame of pose.
Parameters:
`pose` - [in] the pose.
`line` - [in] the line.
Returns:
a Line2DPolar.