72 lines
1.7 KiB
C++
72 lines
1.7 KiB
C++
/* ----------------------------------------------------------------------------
|
|
|
|
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
|
|
* Atlanta, Georgia 30332-0415
|
|
* All Rights Reserved
|
|
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
|
|
|
|
* See LICENSE for the license information
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
/**
|
|
* @file projectiveGeometry.cpp
|
|
* @brief Projective geometry, implemented using tensor library
|
|
* @date Feb 12, 2010
|
|
* @author: Frank Dellaert
|
|
*/
|
|
|
|
#include <boost/foreach.hpp>
|
|
#include <gtsam/base/Matrix.h>
|
|
|
|
#include <gtsam_unstable/geometry/tensorInterface.h>
|
|
#include <gtsam_unstable/geometry/projectiveGeometry.h>
|
|
|
|
namespace gtsam {
|
|
|
|
using namespace std;
|
|
using namespace tensors;
|
|
|
|
/* ************************************************************************* */
|
|
Point2h point2h(double x, double y, double w) {
|
|
double data[3];
|
|
data[0] = x;
|
|
data[1] = y;
|
|
data[2] = w;
|
|
return data;
|
|
}
|
|
|
|
/* ************************************************************************* */
|
|
Line2h line2h(double a, double b, double c) {
|
|
double data[3];
|
|
data[0] = a;
|
|
data[1] = b;
|
|
data[2] = c;
|
|
return data;
|
|
}
|
|
|
|
/* ************************************************************************* */
|
|
Point3h point3h(double X, double Y, double Z, double W) {
|
|
double data[4];
|
|
data[0] = X;
|
|
data[1] = Y;
|
|
data[2] = Z;
|
|
data[3] = W;
|
|
return data;
|
|
}
|
|
|
|
/* ************************************************************************* */
|
|
Plane3h plane3h(double a, double b, double c, double d) {
|
|
double data[4];
|
|
data[0] = a;
|
|
data[1] = b;
|
|
data[2] = c;
|
|
data[3] = d;
|
|
return data;
|
|
}
|
|
|
|
|
|
/* ************************************************************************* */
|
|
|
|
} // namespace gtsam
|