42 #include <visp3/core/vpThetaUVector.h>
46 const double vpThetaUVector::minimum = 0.0001;
47 const unsigned int vpThetaUVector::constr_val_3 = 3;
130 const unsigned int val_3 = 3;
131 const unsigned int index_3 = 3;
132 for (
unsigned int i = 0; i < val_3; ++i) {
133 data[i] = p[i + index_3];
145 const unsigned int index_0 = 0;
146 const unsigned int index_1 = 1;
147 const unsigned int index_2 = 2;
149 s = ((R[1][0] - R[0][1]) * (R[1][0] - R[0][1])) + ((R[index_2][0] - R[0][index_2]) * (R[index_2][0] - R[0][index_2])) +
150 ((R[index_2][index_1] - R[index_1][index_2]) * (R[index_2][index_1] - R[index_1][index_2]));
152 c = ((R[index_0][index_0] + R[index_1][index_1] + R[index_2][index_2]) - 1.0) / 2.0;
156 if ((1 + c) > minimum)
160 data[index_0] = (R[index_2][index_1] - R[index_1][index_2]) / (2.0 * sinc);
161 data[index_1] = (R[index_0][index_2] - R[index_2][index_0]) / (2.0 * sinc);
162 data[index_2] = (R[index_1][index_0] - R[index_0][index_1]) / (2.0 * sinc);
167 if ((R[0][0] - c) > std::numeric_limits<double>::epsilon()) {
168 x = sqrt((R[0][0] - c) / (1 - c));
172 if ((R[1][1] - c) > std::numeric_limits<double>::epsilon()) {
173 y = sqrt((R[1][1] - c) / (1 - c));
177 if ((R[index_2][index_2] - c) > std::numeric_limits<double>::epsilon()) {
178 z = sqrt((R[index_2][index_2] - c) / (1 - c));
181 if ((x > y) && (x > z)) {
182 if ((R[index_2][index_1] - R[index_1][index_2]) < 0) {
193 if ((R[index_0][index_2] - R[index_2][index_0]) < 0) {
204 if ((R[1][0] - R[0][1]) < 0) {
214 data[index_0] = theta * x;
215 data[index_1] = theta * y;
216 data[index_2] = theta * z;
268 const unsigned int val_3 = 3;
269 if (tu.size() != val_3) {
273 for (
unsigned int i = 0; i < val_3; ++i) {
285 const unsigned int val_3 = 3;
286 if (tu.
size() != val_3) {
290 for (
unsigned int i = 0; i < val_3; ++i) {
302 const unsigned int index_0 = 0;
303 const unsigned int index_1 = 1;
304 const unsigned int index_2 = 2;
337 for (
unsigned int i = 0; i <
dsize; ++i) {
377 unsigned int l_size =
size();
378 for (
unsigned int i = 0; i < l_size; ++i) {
419 const unsigned int val_3 = 3;
424 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
428 for (
unsigned int i = 0; i < val_3; ++i) {
429 u[i] =
data[i] / theta;
461 const unsigned int index_0 = 0;
462 const unsigned int index_1 = 1;
463 const unsigned int index_2 = 2;
500 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
504 const unsigned int val_3 = 3;
505 for (
unsigned int i = 0; i < val_3; ++i) {
506 u[i] =
data[i] / theta;
524 double c = 2 * std::acos((std::cos(a_2) * std::cos(b_2)) - (
vpColVector::dotProd(a_hat_sin_2, b_hat_sin_2)));
525 vpColVector d = ((std::sin(a_2) * std::cos(b_2) * a_hat) + (std::cos(a_2) * std::sin(b_2) * b_hat)) +
527 d = (c * d) / std::sin(c / 2.0);
532 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
556 if (list.size() >
size()) {
559 "Cannot set theta u vector out of bounds. It has only %d values while you try to initialize with %d values",
560 size(), list.size()));
562 std::copy(list.begin(), list.end(),
data);
double * data
Address of the first element of the data array.
unsigned int dsize
Current array size (rowNum * colNum)
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of column vector and the associated operations.
static double dotProd(const vpColVector &a, const vpColVector &b)
static vpColVector crossProd(const vpColVector &a, const vpColVector &b)
void resize(unsigned int i, bool flagNullify=true)
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void extract(vpRotationMatrix &R) const
static double sinc(double x)
static int sign(double x)
Implementation of a pose vector and operations on poses.
Implementation of a rotation vector as quaternion angle minimal representation.
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a generic rotation vector.
Implementation of a rotation vector as Euler angle minimal representation.
Implementation of a rotation vector as Euler angle minimal representation.
Implementation of a rotation vector as Euler angle minimal representation.
Implementation of a rotation vector as axis-angle minimal representation.
vpThetaUVector operator*(const vpThetaUVector &tu_b) const
void extract(double &theta, vpColVector &u) const
vpThetaUVector & buildFrom(const vpHomogeneousMatrix &M)
vpThetaUVector & operator=(const vpColVector &tu)