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)); }
168 return ((std::fabs(rd1 - rd2) <= std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) &&
169 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) &&
170 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
189 return ((std::fabs(rd1 - rd2) > std::fabs(
vpMath::maximum(rd1, rd2)) * std::numeric_limits<double>::epsilon()) ||
190 (std::fabs(ha1 - ha2) <= std::fabs(
vpMath::maximum(ha1, ha2)) * std::numeric_limits<double>::epsilon()) ||
191 (std::fabs(va1 - va2) <= std::fabs(
vpMath::maximum(va1, va2)) * std::numeric_limits<double>::epsilon()));
239 std::ios_base::fmtflags original_flags = s.flags();
245 s.setf(original_flags);
double getRadialDist() const
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.
friend std::ostream & operator<<(std::ostream &s, const vpScanPoint &p)
friend bool operator==(const vpScanPoint &sp1, const vpScanPoint &sp2)
void setPolar(double r_dist, double h_angle, double v_angle)
friend bool operator!=(const vpScanPoint &sp1, const vpScanPoint &sp2)