43#include <visp3/core/vpConfig.h>
44#include <visp3/core/vpMath.h>
81 this->rDist = scanpoint.rDist;
82 this->hAngle = scanpoint.hAngle;
83 this->vAngle = scanpoint.vAngle;
91 inline vpScanPoint(
double r_dist,
double h_angle,
double v_angle) : rDist(r_dist), hAngle(h_angle), vAngle(v_angle)
94 this->hAngle = h_angle;
95 this->vAngle = v_angle;
105 inline void setPolar(
double r_dist,
double h_angle,
double v_angle)
107 this->rDist = r_dist;
108 this->hAngle = h_angle;
109 this->vAngle = v_angle;
118 inline double getVAngle()
const {
return (this->vAngle); }
122 inline double getHAngle()
const {
return (this->hAngle); }
130 inline double getX()
const {
return (rDist * cos(this->hAngle) * cos(this->vAngle)); }
138 inline double getY()
const {
return (rDist * sin(this->hAngle)); }
145 inline double getZ()
const {
return (rDist * cos(this->hAngle) * sin(this->vAngle)); }
147#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
167 return ((std::fabs(rd1 - rd2) <= std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) &&
168 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) &&
169 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
188 return ((std::fabs(rd1 - rd2) > std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) ||
189 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) ||
190 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
242 std::ios_base::fmtflags original_flags = s.flags();
245 s << p.getRadialDist() <<
" " << p.getHAngle() <<
" " << p.getVAngle() <<
" " << p.getX() <<
" " << p.getY() <<
" "
248 s.setf(original_flags);
static Type maximum(const Type &a, const Type &b)
friend bool operator!=(const vpScanPoint &sp1, const vpScanPoint &sp2)
friend std::ostream & operator<<(std::ostream &s, const vpScanPoint &p)
vpScanPoint(double r_dist, double h_angle, double v_angle)
void setPolar(double r_dist, double h_angle, double v_angle)
vpScanPoint & operator=(const vpScanPoint &)=default
vpScanPoint(const vpScanPoint &scanpoint)
double getRadialDist() const
friend bool operator==(const vpScanPoint &sp1, const vpScanPoint &sp2)