Package org.robwork.sdurw
Class Line2DPolar
- java.lang.Object
-
- org.robwork.sdurw.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(Vector2Dd pnt, double theta)
constructor
Line2DPolar(Vector2Dd start, Vector2Dd end)
constructor - The line moving through the segment from 'start' to 'end'.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector2Dd
calcNormal()
get normal of linevoid
delete()
double
dist2(Vector2Dd pnt)
The L_2 distance from 'pnt' to the line.static long
getCPtr(Line2DPolar obj)
double
getRho()
the shortest distance from origo the linedouble
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 Vector2Dd
linePoint(Line2DPolar line)
A supporting point on the line (equal to rho * normal).static Line2DPolar
lineToLocal(Pose2Dd pose, Line2DPolar line)
line given relative to the coordinate frame of pose.static Vector2Dd
normalProjectionVector(Line2DPolar line, Vector2Dd pnt)
The vector for the projection of pnt onto the normal of line.static Vector2Dd
projectionPoint(Line2DPolar line, Vector2Dd pnt)
The point for the projection of 'pnt' onto 'line'.
-
-
-
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 origotheta
- [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 linetheta
- [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 lineend
- [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.
-
-