39#include <visp3/core/vpPlane.h>
110 const unsigned int index_0 = 0;
111 const unsigned int index_1 = 1;
112 const unsigned int index_2 = 2;
161 const unsigned int index_0 = 0;
162 const unsigned int index_1 = 1;
163 const unsigned int index_2 = 2;
192 const unsigned int index_0 = 0;
193 const unsigned int index_1 = 1;
194 const unsigned int index_2 = 2;
200 D = -((
A * P[0]) + (
B * P[1]) + (
C * P[index_2]));
223 const unsigned int index_0 = 0;
224 const unsigned int index_1 = 1;
225 const unsigned int index_2 = 2;
228 a[index_0] = P.
get_X() - Q.get_X();
229 a[index_1] = P.
get_Y() - Q.get_Y();
230 a[index_2] = P.
get_Z() - Q.get_Z();
233 b[index_0] = P.
get_X() - R.get_X();
234 b[index_1] = P.
get_Y() - R.get_Y();
235 b[index_2] = P.
get_Z() - R.get_Z();
239 a[index_0] = P.
get_oX() - Q.get_oX();
240 a[index_1] = P.
get_oY() - Q.get_oY();
241 a[index_2] = P.
get_oZ() - Q.get_oZ();
244 b[index_0] = P.
get_oX() - R.get_oX();
245 b[index_1] = P.
get_oY() - R.get_oY();
246 b[index_2] = P.
get_oZ() - R.get_oZ();
262 double norm = sqrt((
A *
A) + (
B *
B) + (
C *
C));
287 init(P, Q, R, frame);
313 const unsigned int val_3 = 3;
315 const unsigned int index_0 = 0;
316 const unsigned int index_1 = 1;
317 const unsigned int index_2 = 2;
337 const unsigned int val_3 = 3;
339 const unsigned int index_0 = 0;
340 const unsigned int index_1 = 1;
341 const unsigned int index_2 = 2;
368 rho = -((
A * x0) + (
B * y0) + (
C * z0) +
D) / ((
A *
A) + (
B *
B) + (
C *
C));
370 Pproj.
set_X(x0 + (
A * rho));
371 Pproj.
set_Y(y0 + (
B * rho));
372 Pproj.
set_Z(z0 + (
C * rho));
380 rho = -((
A * x0) + (
B * y0) + (
C * z0) +
D) / ((
A *
A) + (
B *
B) + (
C *
C));
392 const unsigned int index_0 = 0;
393 const unsigned int index_1 = 1;
394 const unsigned int index_2 = 2;
397 if ((std::fabs(M0.
get_X()) > std::numeric_limits<double>::epsilon()) ||
398 (std::fabs(M0.
get_Y()) > std::numeric_limits<double>::epsilon()) ||
399 (std::fabs(M0.
get_Z()) > std::numeric_limits<double>::epsilon())) {
405 scal = (
getA() * R[index_0]) + (
getB() * R[index_1]) + (
getC() * R[index_2]);
407 if (std::fabs(scal) > std::numeric_limits<double>::epsilon()) {
414 H[index_0] = M0.
get_X() + (k * R[index_0]);
415 H[index_1] = M0.
get_Y() + (k * R[index_1]);
416 H[index_2] = M0.
get_Z() + (k * R[index_2]);
421 if (std::fabs(scal) > std::numeric_limits<double>::epsilon()) {
427 H[index_0] = k * M1.
get_X();
428 H[index_1] = k * M1.
get_Y();
429 H[index_2] = k * M1.
get_Z();
438 const unsigned int index_0 = 0;
439 const unsigned int index_1 = 1;
440 const unsigned int index_2 = 2;
442 scal = (
A * M1[index_0]) + (
B * M1[index_1]) + (
C * M1[index_2]);
444 if (std::fabs(scal) > std::numeric_limits<double>::epsilon()) {
450 H[index_0] = k * M1[index_0];
451 H[index_1] = k * M1[index_1];
452 H[index_2] = k * M1[index_2];
472 const unsigned int index_0 = 0;
473 const unsigned int index_1 = 1;
474 const unsigned int index_2 = 2;
475 const unsigned int index_3 = 3;
476 A = (cMo[index_0][0] * Ao) + (cMo[index_0][1] * Bo) + (cMo[index_0][index_2] * Co);
477 B = (cMo[index_1][0] * Ao) + (cMo[index_1][1] * Bo) + (cMo[index_1][index_2] * Co);
478 C = (cMo[index_2][0] * Ao) + (cMo[index_2][1] * Bo) + (cMo[index_2][index_2] * Co);
479 D = Do - ((cMo[index_0][index_3] *
A) + (cMo[index_1][index_3] *
B) + (cMo[index_2][index_3] *
C));
490 return (os <<
"(" << p.getA() <<
"," << p.getB() <<
"," << p.getC() <<
"," << p.getD() <<
") ");
Implementation of column vector and the associated operations.
static vpColVector cross(const vpColVector &a, const vpColVector &b)
void resize(unsigned int i, bool flagNullify=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpPlane & init(const vpPoint &P, const vpColVector &normal, const vpPlaneFrame &frame=camera_frame)
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpPlane &p)
double rayIntersection(const vpPoint &M0, const vpPoint &M1, vpColVector &H) const
void changeFrame(const vpHomogeneousMatrix &cMo)
double computeZ(double x, double y) const
vpColVector getNormal() const
void projectionPointOnPlan(const vpPoint &P, vpPoint &Pproj, const vpPlaneFrame &frame=camera_frame) const
vpPlane & operator=(const vpPlane &f)
double getIntersection(const vpColVector &M1, vpColVector &H) const
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
double get_oW() const
Get the point oW coordinate in the object frame.
double get_oX() const
Get the point oX coordinate in the object frame.
void set_W(double cW)
Set the point cW coordinate in the camera frame.
void set_oW(double oW)
Set the point oW coordinate in the object frame.
double get_Y() const
Get the point cY coordinate in the camera frame.
double get_oZ() const
Get the point oZ coordinate in the object frame.
void set_oY(double oY)
Set the point oY coordinate in the object frame.
void set_X(double cX)
Set the point cX coordinate in the camera frame.
double get_W() const
Get the point cW coordinate in the camera frame.
void set_Y(double cY)
Set the point cY coordinate in the camera frame.
double get_Z() const
Get the point cZ coordinate in the camera frame.
void set_oZ(double oZ)
Set the point oZ coordinate in the object frame.
void set_Z(double cZ)
Set the point cZ coordinate in the camera frame.
void set_oX(double oX)
Set the point oX coordinate in the object frame.
double get_oY() const
Get the point oY coordinate in the object frame.
double get_X() const
Get the point cX coordinate in the camera frame.