RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
QuadraticCurve Class Reference

A quadratic curve. More...

#include <QuadraticCurve.hpp>

Inherits ParametricCurve.

Public Types

enum  Type { Elliptic , Hyperbola , Line , Parabola }
 The four possible curve types. More...
 
typedef rw::core::Ptr< QuadraticCurvePtr
 Smart pointer type for QuadraticCurve.
 
typedef rw::core::Ptr< const QuadraticCurveCPtr
 Smart pointer type for a const QuadraticCurve.
 
typedef enum rw::geometry::QuadraticCurve::Type Type
 The four possible curve types.
 
- Public Types inherited from ParametricCurve
typedef rw::core::Ptr< ParametricCurvePtr
 Smart pointer type for ParametricCurve.
 
typedef rw::core::Ptr< const ParametricCurveCPtr
 Smart pointer type for a const ParametricCurve.
 
- Public Types inherited from Curve
typedef rw::core::Ptr< CurvePtr
 Smart pointer type for Curve.
 
typedef rw::core::Ptr< const CurveCPtr
 Smart pointer type for a const Curve.
 

Public Member Functions

 QuadraticCurve (const rw::math::Vector3D< double > &c, const rw::math::Vector3D< double > &u, const rw::math::Vector3D< double > &v, const Type &type)
 Construct quadratic curve given by the expression \( \mathbf{p} = \mathbf{c} + r(t) \mathbf{u} + s(t) \mathbf{v} \), where u and v are orthogonal vectors. More...
 
virtual ~QuadraticCurve ()
 Destrcutor.
 
QuadraticCurve::Ptr transform (const rw::math::Transform3D< double > &T) const
 Transform curve. More...
 
QuadraticCurve::Ptr transform (const rw::math::Vector3D< double > &P) const
 Transform curve. More...
 
QuadraticCurve::Ptr scale (double factor) const
 Get a scaled version of the curve. More...
 
QuadraticCurve::Ptr reverse () const
 Make a curve where time variable runs in opposite direction. More...
 
QuadraticCurve::Ptr clone () const
 Make a copy of the curve. More...
 
virtual std::pair< double, double > extremums (const rw::math::Vector3D< double > &dir) const
 Get extremums of curve in given direction. More...
 
virtual std::list< rw::math::Vector3D< double > > discretizeAdaptive (double stepsPerRevolution) const
 Make a discretization of the curve. More...
 
virtual OBB obr () const
 Bounding rectangle of curve. More...
 
virtual std::vector< rw::math::Vector3D< double > > closestPoints (const rw::math::Vector3D< double > &p) const
 Get the closest points on the curve to a point p. More...
 
virtual bool equals (rw::core::Ptr< const rw::geometry::Curve > curve, double eps) const
 Check if this curve is equal to another curve. More...
 
virtual rw::math::Vector3D< double > x (double t) const
 Evaluate a point on the curve. More...
 
virtual rw::math::Vector3D< double > dx (double t) const
 Evaluate the derivative in a point on the curve. More...
 
virtual rw::math::Vector3D< double > ddx (double t) const
 Evaluate the second derivative in a point on the curve. More...
 
virtual rw::math::Vector3D< double > operator() (double t) const
 Evaluate a point on the curve. More...
 
virtual bool hasLimits () const
 Check if the curve is limited. More...
 
virtual const std::pair< double, double > & limits () const
 Get the limits of the curve segment. More...
 
virtual bool inLimits (double t) const
 Check if the parameter t is inside the limits set for the curve. More...
 
virtual void setLimits (const std::pair< double, double > &limits)
 Set parameter limits for the curve. More...
 
virtual double curvature (double t) const
 The curvature in a given point on the curve. More...
 
virtual std::vector< double > closestTimes (const rw::math::Vector3D< double > &p) const
 Get the parameter values where the curve is closest to a point p. More...
 
virtual double closestTime (const rw::math::Vector3D< double > &p) const
 Get the parameter value where the curve is closest to a point p. More...
 
const rw::math::Vector3D< double > & c () const
 The point c. More...
 
const rw::math::Vector3D< double > & u () const
 The vector u. More...
 
const rw::math::Vector3D< double > & v () const
 The vector v. More...
 
Type type () const
 Get the type of curve. More...
 
QuadraticCurveoperator= (const QuadraticCurve &rhs)
 
- Public Member Functions inherited from ParametricCurve
 ParametricCurve ()
 Constructor.
 
virtual ~ParametricCurve ()
 Destructor.
 
ParametricCurve::Ptr transform (const rw::math::Transform3D< double > &T) const
 Transform curve. More...
 
ParametricCurve::Ptr transform (const rw::math::Vector3D< double > &P) const
 Transform curve. More...
 
ParametricCurve::Ptr scale (double factor) const
 Get a scaled version of the curve. More...
 
ParametricCurve::Ptr reverse () const
 Make a curve where time variable runs in opposite direction. More...
 
ParametricCurve::Ptr clone () const
 Make a copy of the curve. More...
 
- Public Member Functions inherited from Curve
 Curve ()
 Constructor.
 
virtual ~Curve ()
 Destructor.
 
rw::core::Ptr< Curvetransform (const rw::math::Transform3D< double > &T) const
 Transform curve. More...
 
rw::core::Ptr< Curvetransform (const rw::math::Vector3D< double > &P) const
 Transform curve. More...
 
rw::core::Ptr< Curvescale (double factor) const
 Get a scaled version of the curve. More...
 
rw::core::Ptr< Curvereverse () const
 Make a curve where time variable runs in opposite direction. More...
 
rw::core::Ptr< Curveclone () const
 Make a copy of the curve. More...
 

Detailed Description

A quadratic curve.

A quadratic curve is given explicitly by the expression \( \mathbf{p} = \mathbf{c} + r(t) \mathbf{u} + s(t) \mathbf{v} \) where \( \mathbf{c},\mathbf{u},\mathbf{v},\mathbf{p} \in \mathbb{R}^3 \) and \( \mathbf{u}^T \mathbf{v} = 0\) .

The following four types of curves are possible:

Member Enumeration Documentation

◆ Type

enum Type

The four possible curve types.

Enumerator
Elliptic 

Ellipse \( \mathbf{p} = \mathbf{c} + \mathbf{u} \sin t + \mathbf{v} < \cos t\)

Hyperbola 

Hyperbola \( \mathbf{p} = \mathbf{c} + \mathbf{u} \sinh t + < \mathbf{v} \cosh t\)

Line 

Line \( \mathbf{p} = \mathbf{c} + \mathbf{u} t\).

Parabola 

Parabola \( \mathbf{p} = \mathbf{c} + \mathbf{u} t + \mathbf{v} t^2\).

Constructor & Destructor Documentation

◆ QuadraticCurve()

QuadraticCurve ( const rw::math::Vector3D< double > &  c,
const rw::math::Vector3D< double > &  u,
const rw::math::Vector3D< double > &  v,
const Type type 
)

Construct quadratic curve given by the expression \( \mathbf{p} = \mathbf{c} + r(t) \mathbf{u} + s(t) \mathbf{v} \), where u and v are orthogonal vectors.

Parameters
c[in] offset of curve.
u[in] first direction.
v[in] second direction.
type[in] the type of curve.

Member Function Documentation

◆ c()

const rw::math::Vector3D<double>& c ( ) const
inline

The point c.

Returns
the point \( c \in \mathbb{R}^3 \).

◆ clone()

QuadraticCurve::Ptr clone ( ) const

Make a copy of the curve.

Returns
a new copy of the curve.

◆ closestPoints()

virtual std::vector<rw::math::Vector3D<double> > closestPoints ( const rw::math::Vector3D< double > &  p) const
virtual

Get the closest points on the curve to a point p.

Notice that the limits are taken into account.

Parameters
p[in] the point to find closest values for.
Returns
a vector of closest points to p.

Implements ParametricCurve.

◆ closestTime()

virtual double closestTime ( const rw::math::Vector3D< double > &  p) const
virtual

Get the parameter value where the curve is closest to a point p.

Notice that the limits are taken into account.

Parameters
p[in] the point to find closest values for.
Returns
the point on the curve closest to p. If multiple points are equally close to p, only one of those points are returned.

Implements ParametricCurve.

◆ closestTimes()

virtual std::vector<double> closestTimes ( const rw::math::Vector3D< double > &  p) const
virtual

Get the parameter values where the curve is closest to a point p.

Notice that the limits are taken into account.

Parameters
p[in] the point to find closest values for.
Returns
a list of parameter values.

Implements ParametricCurve.

◆ curvature()

virtual double curvature ( double  t) const
virtual

The curvature in a given point on the curve.

This function does not take the limits into account.

Parameters
t[in] the parameter to evaluate the curvature for.
Returns
the curvature.

Implements ParametricCurve.

◆ ddx()

virtual rw::math::Vector3D<double> ddx ( double  t) const
virtual

Evaluate the second derivative in a point on the curve.

Parameters
t[in] the parameter to find second derivative for.
Returns
a second derivative vector \( p \in \mathbb{R}^3 \) .

Implements ParametricCurve.

◆ discretizeAdaptive()

virtual std::list<rw::math::Vector3D<double> > discretizeAdaptive ( double  stepsPerRevolution) const
virtual

Make a discretization of the curve.

The curve must be limited. The discretization is based on the curvature, such that the sampling starts at maximum curvature points (or in limits). The step size to the next point is based on the curvature in the current point.

A line will always give to points, regardless of the chosen number of steps per revolution.

Parameters
stepsPerRevolution[in] the number of points to sample if the curve is a perfect circle.
Returns
a list of points on the curve.

Implements ParametricCurve.

◆ dx()

virtual rw::math::Vector3D<double> dx ( double  t) const
virtual

Evaluate the derivative in a point on the curve.

Parameters
t[in] the parameter to find derivative for.
Returns
a derivative vector \( p \in \mathbb{R}^3 \) .

Implements ParametricCurve.

◆ equals()

virtual bool equals ( rw::core::Ptr< const rw::geometry::Curve curve,
double  eps 
) const
virtual

Check if this curve is equal to another curve.

Parameters
curve[in] other curve.
eps[in] distance threshold.
Returns
true if curves are identical, false otherwise.

Implements ParametricCurve.

◆ extremums()

virtual std::pair<double, double> extremums ( const rw::math::Vector3D< double > &  dir) const
virtual

Get extremums of curve in given direction.

Notice that the limits are taken into account.

Parameters
dir[in] direction to get extremums for.
Returns
the minimum and maximum value of the curve in the given direction.

Implements ParametricCurve.

◆ hasLimits()

virtual bool hasLimits ( ) const
inlinevirtual

Check if the curve is limited.

Returns
true if curve is limited, false otherwise.

Implements ParametricCurve.

◆ inLimits()

virtual bool inLimits ( double  t) const
virtual

Check if the parameter t is inside the limits set for the curve.

Parameters
t[in] the parameter to check.
Returns
true if inside limits, false otherwise.

Implements ParametricCurve.

◆ limits()

virtual const std::pair<double, double>& limits ( ) const
inlinevirtual

Get the limits of the curve segment.

The returned values are only valid when hasLimits() returns true.

Returns
the minimum and maximum parameter values on the curve.

Implements ParametricCurve.

◆ obr()

virtual OBB obr ( ) const
virtual

Bounding rectangle of curve.

The curve must be limited.

Returns
the bounding rectangle.

Implements ParametricCurve.

◆ operator()()

virtual rw::math::Vector3D<double> operator() ( double  t) const
virtual

Evaluate a point on the curve.

Parameters
t[in] the parameter to find point for.
Returns
the vector \( p \in \mathbb{R}^3 \) .

Implements ParametricCurve.

◆ reverse()

QuadraticCurve::Ptr reverse ( ) const

Make a curve where time variable runs in opposite direction.

Returns
reversed curve.

◆ scale()

QuadraticCurve::Ptr scale ( double  factor) const

Get a scaled version of the curve.

Parameters
factor[in] the factor to scale with.
Returns
a new scaled curve.

◆ setLimits()

virtual void setLimits ( const std::pair< double, double > &  limits)
virtual

Set parameter limits for the curve.

Parameters
limits[in] the minimum and maximum parameter values on the curve.

Implements ParametricCurve.

◆ transform() [1/2]

QuadraticCurve::Ptr transform ( const rw::math::Transform3D< double > &  T) const

Transform curve.

Parameters
T[in] transformation of curve.
Returns
a new transformed curve.

◆ transform() [2/2]

QuadraticCurve::Ptr transform ( const rw::math::Vector3D< double > &  P) const

Transform curve.

Parameters
P[in] positional offset.
Returns
a new transformed curve.

◆ type()

Type type ( ) const
inline

Get the type of curve.

Returns
the type of curve.

◆ u()

const rw::math::Vector3D<double>& u ( ) const
inline

The vector u.

Returns
the vector \( u \in \mathbb{R}^3 \).

◆ v()

const rw::math::Vector3D<double>& v ( ) const
inline

The vector v.

Returns
the vector \( v \in \mathbb{R}^3 \).

◆ x()

virtual rw::math::Vector3D<double> x ( double  t) const
virtual

Evaluate a point on the curve.

Parameters
t[in] the parameter to find point for.
Returns
the vector \( p \in \mathbb{R}^3 \) .

Implements ParametricCurve.


The documentation for this class was generated from the following file: