RobWorkProject  23.9.11-
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
CircleModel Class Reference

a model of a circle, represented as a normal, a center and a radius More...

#include <CircleModel.hpp>

Public Member Functions

 CircleModel ()
 constructor
 
 CircleModel (const rw::math::Vector3D<> &c, const rw::math::Vector3D<> &n, double radi)
 contructor More...
 
 CircleModel (rw::math::Vector3D<> &p1, rw::math::Vector3D<> &p2, rw::math::Vector3D<> &p3)
 constructor from 3 unique points on circle More...
 
void refit (const std::vector< rw::math::Vector3D<>> &points)
 refit the circle from a number of points. Use a least square fit. More...
 
bool isClose (const CircleModel &circ, double epsilon) const
 tests if two circles are "equal" which is within some epsilon of each other More...
 
bool isClose (const rw::math::Vector3D<> &p, double epsilon) const
 tests if a point is within a distance epsilon of this circle. More...
 

Static Public Member Functions

static CircleModel fitTo (const std::vector< rw::math::Vector3D<>> &points)
 create a circle from a number of points. Use a least square fit. More...
 

Public Attributes

rw::math::Vector3D _center
 
rw::math::Vector3D _n
 
double _r
 

Friends

std::ostream & operator<< (std::ostream &os, const CircleModel &model)
 Ouputs CircleModel to stream. More...
 

Detailed Description

a model of a circle, represented as a normal, a center and a radius

Constructor & Destructor Documentation

◆ CircleModel() [1/2]

CircleModel ( const rw::math::Vector3D<> &  c,
const rw::math::Vector3D<> &  n,
double  radi 
)

contructor

Parameters
c[in] center
n[in] normal
radi[in] radius
Returns

◆ CircleModel() [2/2]

constructor from 3 unique points on circle

Parameters
p1[in] point on circle
p2[in] point on circle
p3[in] point on circle

Member Function Documentation

◆ fitTo()

static CircleModel fitTo ( const std::vector< rw::math::Vector3D<>> &  points)
static

create a circle from a number of points. Use a least square fit.

Parameters
points[in] the vector of points that the circle is fitted to

◆ isClose() [1/2]

bool isClose ( const CircleModel circ,
double  epsilon 
) const

tests if two circles are "equal" which is within some epsilon of each other

Parameters
circ[in] the other circle
epsilon[in] how close they need to be.
Returns

◆ isClose() [2/2]

bool isClose ( const rw::math::Vector3D<> &  p,
double  epsilon 
) const

tests if a point is within a distance epsilon of this circle.

Parameters
p[in] point in 3D
epsilon[in] max distance that p can be from this circle.
Returns
true if p is within epsilon of this circle

◆ refit()

void refit ( const std::vector< rw::math::Vector3D<>> &  points)

refit the circle from a number of points. Use a least square fit.

Parameters
points[in] the vector of points that the circle is fitted to

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CircleModel model 
)
friend

Ouputs CircleModel to stream.

Parameters
os[in/out] stream to use
model[in] a CircleModel
Returns
the resulting stream

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