RobWorkProject  24.5.15-
Line2DPolar Class Reference

Describes a line in 2D in polar coordinates. More...

#include <Line2DPolar.hpp>

## Public Member Functions

Line2DPolar (double rho=0, double theta=0)
constructor More...

Line2DPolar (const rw::math::Vector2D<> &pnt, double theta)
constructor More...

Line2DPolar (const rw::math::Vector2D<> &start, const rw::math::Vector2D<> &end)
constructor - The line moving through the segment from 'start' to 'end'. More...

Line2DPolar (const Line2D &line)
constructor - The line moving through the line segment. More...

double getRho () const
the shortest distance from origo the line More...

double getTheta () const
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. More...

rw::math::Vector2D calcNormal () const
get normal of line

double dist2 (const rw::math::Vector2D<> &pnt) const
The L_2 distance from 'pnt' to the line.

## Static Public Member Functions

static rw::math::Vector2D projectionPoint (const Line2DPolar &line, const rw::math::Vector2D<> &pnt)
The point for the projection of 'pnt' onto 'line'.

static rw::math::Vector2D linePoint (const Line2DPolar &line)
A supporting point on the line (equal to rho * normal).

static rw::math::Vector2D normalProjectionVector (const Line2DPolar &line, const rw::math::Vector2D<> &pnt)
The vector for the projection of pnt onto the normal of line. More...

static Line2DPolar lineToLocal (const rw::math::Pose2D<> &pose, const Line2DPolar &line)
line given relative to the coordinate frame of pose. More...

## Related Functions

(Note that these are not member functions.)

template<>
void write (const rw::math::Line2DPolar &sobject, rw::common::OutputArchive &oarchive, const std::string &id)

template<>
void read (rw::math::Line2DPolar &sobject, rw::common::InputArchive &iarchive, const std::string &id)

## Detailed Description

Describes a line in 2D in polar coordinates.

## ◆ Line2DPolar() [1/4]

 Line2DPolar ( double rho = 0, double theta = 0 )

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() [2/4]

 Line2DPolar ( const rw::math::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() [3/4]

 Line2DPolar ( const rw::math::Vector2D<> & start, const rw::math::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() [4/4]

 Line2DPolar ( const Line2D & line )

constructor - The line moving through the line segment.

Parameters
 line [in] the line described as a segment

## ◆ getRho()

 double getRho ( ) const
inline

the shortest distance from origo the line

Returns

## ◆ getTheta()

 double getTheta ( ) const
inline

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

## ◆ lineToLocal()

 static Line2DPolar lineToLocal ( const rw::math::Pose2D<> & pose, const Line2DPolar & line )
static

line given relative to the coordinate frame of pose.

Parameters
 pose [in] the pose. line [in] the line.
Returns
a Line2DPolar.

## ◆ normalProjectionVector()

 static rw::math::Vector2D normalProjectionVector ( const Line2DPolar & line, const rw::math::Vector2D<> & pnt )
static

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.

## Friends And Related Function Documentation

 void read ( rw::math::Line2DPolar & sobject, rw::common::InputArchive & iarchive, const std::string & id )
related

Parameters
 sobject [out] the object in which the data should be streamed into iarchive [in] the InputArchive from which to read data. id [in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

## ◆ write()

 void write ( const rw::math::Line2DPolar & sobject, rw::common::OutputArchive & oarchive, const std::string & id )
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
 sobject [in] the object from which the data should be streamed. oarchive [out] the OutputArchive in which data should be written. id [in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

The documentation for this class was generated from the following file:
• Line2DPolar.hpp