44 #include <visp/vpMath.h>
82 this->rDist = scanpoint.rDist;
83 this->hAngle = scanpoint.hAngle;
84 this->vAngle = scanpoint.vAngle;
92 inline vpScanPoint(
double r_dist,
double h_angle,
double v_angle)
93 : rDist(r_dist), hAngle(h_angle), vAngle(v_angle)
96 this->hAngle = h_angle;
97 this->vAngle = v_angle;
107 inline void setPolar(
double r_dist,
double h_angle,
double v_angle) {
108 this->rDist = r_dist;
109 this->hAngle = h_angle;
110 this->vAngle = v_angle;
116 return ( this->rDist );
122 return ( this->vAngle );
128 return ( this->hAngle );
138 return ( rDist * cos(this->hAngle) * cos(this->vAngle) );
148 return ( rDist * sin(this->hAngle) );
157 return ( rDist * cos(this->hAngle) * sin(this->vAngle) );
179 return ( ( std::fabs(rd1 - rd2) <= std::fabs(
vpMath::maximum(rd1,rd2)) * std::numeric_limits<double>::epsilon() )
181 ( std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1,ha2)) * std::numeric_limits<double>::epsilon() )
183 ( std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1,va2)) * std::numeric_limits<double>::epsilon() ) );
202 return ( ( std::fabs(rd1 - rd2) > std::fabs(
vpMath::maximum(rd1,rd2)) * std::numeric_limits<double>::epsilon() )
204 ( std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1,ha2)) * std::numeric_limits<double>::epsilon() )
206 ( std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1,va2)) * std::numeric_limits<double>::epsilon() ) );
251 inline std::ostream &operator << (std::ostream &s,
const vpScanPoint &p) {
252 std::ios_base::fmtflags original_flags = s.flags();
261 s.setf(original_flags);
vpScanPoint(const vpScanPoint &scanpoint)
vpScanPoint(double r_dist, double h_angle, double v_angle)
static Type maximum(const Type &a, const Type &b)
Class that defines a single laser scanner point.
double getRadialDist() const
friend bool operator==(const vpScanPoint &sp1, const vpScanPoint &sp2)
friend std::ostream & operator<<(std::ostream &s, const vpScanPoint &p)
void setPolar(double r_dist, double h_angle, double v_angle)
friend bool operator!=(const vpScanPoint &sp1, const vpScanPoint &sp2)