skew method, minor things

release/4.3a0
Frank Dellaert 2013-12-17 05:22:36 +00:00
parent 99b5edf89e
commit b4139842a1
2 changed files with 27 additions and 21 deletions

View File

@ -54,8 +54,12 @@ Matrix Sphere2::getBasis() const {
/* ************************************************************************* */
/// The print fuction
void Sphere2::print(const std::string& s) const {
printf("%s(x, y, z): (%.3lf, %.3lf, %.3lf)\n", //
s.c_str(), p_.x(), p_.y(), p_.z());
printf("(%.3lf, %.3lf, %.3lf)\n", s.c_str(), p_.x(), p_.y(), p_.z());
}
/* ************************************************************************* */
Matrix Sphere2::skew() const {
return skewSymmetric(p_.x(), p_.y(), p_.z());
}
/* ************************************************************************* */

View File

@ -29,29 +29,21 @@ private:
Point3 p_; ///< The location of the point on the unit sphere
/// Returns the axis of rotations
Matrix getBasis() const;
public:
/// The constructors
/// @name Constructors
/// @{
/// Default constructor
Sphere2() :
p_(Point3(1.0, 0.0, 0.0)) {
p_(1.0, 0.0, 0.0) {
}
/// Copy constructor
Sphere2(const Sphere2& s) {
p_ = s.p_ / s.p_.norm();
}
/// Destructor
~Sphere2() {
}
/// Field constructor
Sphere2(const Point3& p) {
p_ = p / p.norm();
/// Construct from point
Sphere2(const Point3& p) :
p_(p / p.norm()) {
}
/// @}
/// @name Testable
/// @{
@ -65,6 +57,17 @@ public:
}
/// @}
/// @name Other functionality
/// @{
/// Returns the local coordinate frame to tangent plane
Matrix getBasis() const;
/// Return skew-symmetric associated with 3D point on unit sphere
Matrix skew() const;
/// @}
/// @name Manifold
/// @{
@ -85,7 +88,6 @@ public:
Vector localCoordinates(const Sphere2& s) const;
/// @}
};
} // namespace gtsam