45 #include <visp3/core/vpConfig.h>
46 #include <visp3/core/vpMath.h>
83 this->rDist = scanpoint.rDist;
84 this->hAngle = scanpoint.hAngle;
85 this->vAngle = scanpoint.vAngle;
93 inline vpScanPoint(
double r_dist,
double h_angle,
double v_angle) : 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)
109 this->rDist = r_dist;
110 this->hAngle = h_angle;
111 this->vAngle = v_angle;
120 inline double getVAngle()
const {
return (this->vAngle); }
124 inline double getHAngle()
const {
return (this->hAngle); }
132 inline double getX()
const {
return (rDist * cos(this->hAngle) * cos(this->vAngle)); }
140 inline double getY()
const {
return (rDist * sin(this->hAngle)); }
147 inline double getZ()
const {
return (rDist * cos(this->hAngle) * sin(this->vAngle)); }
149 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
169 return ((std::fabs(rd1 - rd2) <= std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) &&
170 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) &&
171 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
190 return ((std::fabs(rd1 - rd2) > std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) ||
191 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) ||
192 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
244 std::ios_base::fmtflags original_flags = s.flags();
250 s.setf(original_flags);
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
static Type maximum(const Type &a, const Type &b)
Class that defines a single laser scanner point.
friend bool operator!=(const vpScanPoint &sp1, const vpScanPoint &sp2)
friend std::ostream & operator<<(std::ostream &s, const vpScanPoint &p)
vpScanPoint & operator=(const vpScanPoint &)=default
vpScanPoint(double r_dist, double h_angle, double v_angle)
void setPolar(double r_dist, double h_angle, double v_angle)
vpScanPoint(const vpScanPoint &scanpoint)
double getRadialDist() const
friend bool operator==(const vpScanPoint &sp1, const vpScanPoint &sp2)