38 #include <visp3/core/vpMath.h>
80 this->rDist = scanpoint.rDist;
81 this->hAngle = scanpoint.hAngle;
82 this->vAngle = scanpoint.vAngle;
90 inline vpScanPoint(
double r_dist,
double h_angle,
double v_angle) : rDist(r_dist), hAngle(h_angle), vAngle(v_angle)
93 this->hAngle = h_angle;
94 this->vAngle = v_angle;
104 inline void setPolar(
double r_dist,
double h_angle,
double v_angle)
106 this->rDist = r_dist;
107 this->hAngle = h_angle;
108 this->vAngle = v_angle;
117 inline double getVAngle()
const {
return (this->vAngle); }
121 inline double getHAngle()
const {
return (this->hAngle); }
129 inline double getX()
const {
return (rDist * cos(this->hAngle) * cos(this->vAngle)); }
137 inline double getY()
const {
return (rDist * sin(this->hAngle)); }
144 inline double getZ()
const {
return (rDist * cos(this->hAngle) * sin(this->vAngle)); }
164 return ((std::fabs(rd1 - rd2) <= std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) &&
165 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) &&
166 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
185 return ((std::fabs(rd1 - rd2) > std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) ||
186 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) ||
187 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
235 std::ios_base::fmtflags original_flags = s.flags();
241 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)