All Classes Namespaces Files Functions Variables Typedefs Macros Pages
roboptim::capsule::DistanceCapsulePoint Class Reference

Distance to point RobOptim function. More...

#include <roboptim/capsule/distance-capsule-point.hh>

Inheritance diagram for roboptim::capsule::DistanceCapsulePoint:
Collaboration diagram for roboptim::capsule::DistanceCapsulePoint:

Public Member Functions

 DistanceCapsulePoint (const point_t &point, std::string name="distance to point") throw ()
 Constructor. More...
 
 ~DistanceCapsulePoint () throw ()
 
virtual const point_tpoint () const throw ()
 Get point attribute. More...
 

Protected Member Functions

virtual void impl_compute (result_t &result, const argument_t &argument) const throw ()
 Computes the distance from capsule to a point. More...
 
virtual void impl_gradient (gradient_t &gradient, const argument_t &argument, size_type functionId=0) const throw ()
 Compute of the distance gradient with respect to the capsule parameters. More...
 

Detailed Description

Distance to point RobOptim function.

Constructor & Destructor Documentation

roboptim::capsule::DistanceCapsulePoint::DistanceCapsulePoint ( const point_t point,
std::string  name = "distance to point" 
)
throw (
)

Constructor.

Parameters
pointpoint that will be used in computing distance between the capsule and the point.
roboptim::capsule::DistanceCapsulePoint::~DistanceCapsulePoint ( )
throw (
)

Member Function Documentation

void roboptim::capsule::DistanceCapsulePoint::impl_compute ( result_t &  result,
const argument_t argument 
) const
throw (
)
protectedvirtual

Computes the distance from capsule to a point.

If the result is negative, the point is inside the capsule, otherwise it is outside the capsule.

Parameters
argumentvector containing the capsule parameters. It contains in this order: the segment first end point coordinates, the segment second end point coordinates, the capsule radius.

References roboptim::capsule::distancePointToSegment().

void roboptim::capsule::DistanceCapsulePoint::impl_gradient ( gradient_t &  gradient,
const argument_t argument,
size_type  functionId = 0 
) const
throw (
)
protectedvirtual

Compute of the distance gradient with respect to the capsule parameters.

Parameters
argumentvector containing the capsule parameters. It contains in this order: the segment first end point coordinates, the segment second end point coordinates, the capsule radius.

References roboptim::capsule::projectionOnSegment().

const point_t & roboptim::capsule::DistanceCapsulePoint::point ( ) const
throw (
)
virtual

Get point attribute.