41 #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) 172 return ((std::fabs(rd1 - rd2) <= std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) &&
173 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) &&
174 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
193 return ((std::fabs(rd1 - rd2) > std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) ||
194 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) ||
195 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
243 std::ios_base::fmtflags original_flags = s.flags();
249 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 std::ostream & operator<<(std::ostream &s, const vpScanPoint &p)
friend bool operator==(const vpScanPoint &sp1, const vpScanPoint &sp2)
vpScanPoint & operator=(const vpScanPoint &)=default
void setPolar(double r_dist, double h_angle, double v_angle)
friend bool operator!=(const vpScanPoint &sp1, const vpScanPoint &sp2)