31#ifndef _GranOO_libGeom_Vector_hpp_
32#define _GranOO_libGeom_Vector_hpp_
39#include "GranOO3/3rdParty/Eigen/Dense"
46#include <boost/archive/text_oarchive.hpp>
47#include <boost/archive/text_iarchive.hpp>
79 static std::string
class_ID() {
return "Vector";}
82 static const int N = 3;
107 const double &
x()
const;
109 const double &
y()
const;
111 const double &
z()
const;
125 template <
typename Axis>
double&
val();
126 template <
typename Axis>
const double&
val()
const;
151 std::string
info()
const;
152 void add_glob(
const std::string&
id);
156 template<
class Archive>
163#ifndef DOXYGEN_SHOULD_SKIP_THIS
166 template<
class Archive>
190 : coord(pt[0], pt[1], pt[2]){
196 return *
reinterpret_cast<Point*
> (
this);
201 return *
reinterpret_cast<const Point*
> (
this);
264 template <
typename Axis>
inline
270 template <
typename Axis>
inline
332 return out << v.x() <<
"\t" << v.y() <<
"\t" << v.z() <<
"\t";
337 return in >> v.x() >> v.y() >> v.z();
347 return a.
x()*b.x() + a.y()*b.y() + a.z()*b.z();
399 return x()*
x() +
y()*
y() +
z()*
z();
404 return fabs(
x()) + fabs(
y()) + fabs(
z());
433 const double n =
norm();
447 return Vector (a.x() + b.x(), a.y() + b.y(), a.z() + b.z());
452 return Vector (a.x() - b.x(), a.y() - b.y(), a.z() - b.z());
457 return Vector (-a.x(), -a.y(), -a.z());
462 return Vector (d*a.x(), d*a.y(), d*a.z());
468 return Vector (a.x() / k, a.y() / k, a.z() / k);
473 return sqrt(
x()*
x() +
y()*
y() +
z()*
z());
478 return Vector (a.y()*b.z() - a.z()*b.y(),
479 a.z()*b.x() - a.x()*b.z(),
480 a.x()*b.y() - a.y()*b.x());
485 const double n =
norm();
#define SafeModeAssert(condition, message)
Definition Macro.hpp:47
static Vector & glob(const std::string &id)
Definition Vector.cpp:46
const Point & to_point() const
void operator+=(const Vector &v)
void project_on_plane(const Vector &normal)
Definition Vector.cpp:102
void project_on_axis(const Vector &axis)
Definition Vector.cpp:93
void set_x(const double &)
void serialize(Archive &ar, const unsigned int)
static const Vector & null()
Definition Vector.hpp:81
void operator*=(double k)
Vector orthogonal_vector() const
Definition Vector.cpp:111
static Vector * new_object(const TiXmlElement *el)
Definition Vector.cpp:75
void set_z(const double &)
double squared_norm() const
void operator/=(double k)
void add_glob(const std::string &id)
Definition Vector.cpp:123
void operator-=(const Vector &v)
const double & val() const
static const int N
Definition Vector.hpp:82
void set_y(const double &)
Eigen::Matrix< double, 3, 1 > coord
Definition Vector.hpp:160
std::string info() const
Definition Vector.cpp:86
static std::string class_ID()
Definition Vector.hpp:79
friend class boost::serialization::access
Definition Vector.hpp:155
Vector & operator=(const Vector &v)
const double & operator()(unsigned int i) const
Vector(double x, double y, double z)
This namespace group the entire Geom library.
Vector operator^(const Vector &v1, const Vector &v2)
Vector double_cross(const Vector &v1, const Vector &v2)
std::ostream & operator<<(std::ostream &, const EulerAngle &)
SymTensor operator+(const SymTensor &m1, const SymTensor &m2)
double get_angle_between_unit_vector(const Vector &a, const Vector &b)
SymTensor operator-(const SymTensor &m1, const SymTensor &m2)
bool operator!=(const EulerAngle &, const EulerAngle &)
SymTensor operator/(const SymTensor &m, const double &d)
std::istream & operator>>(std::istream &in, Vector &v)
Vector operator*(const SymTensor &m, const Vector &v)
bool operator==(const EulerAngle &, const EulerAngle &)
Definition Common.hpp:198
x y * z
Definition Exprtk.hpp:11139
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)
Definition Constant.hpp:48
static double epsilon
Definition Constant.hpp:58
static const Geom::Vector vector
Definition Constant.hpp:75