19#include "eli/code_eli.hpp"
20typedef Eigen::Matrix< double, 1, 3 > threed_point_type;
246 vec3d(
double xx,
double yy,
double zz );
250 vec3d(
const threed_point_type &a );
252 vec3d(
const double a[3] );
253 vec3d(
const float a[3] );
254 vec3d(
const std::vector<double> &a );
257 vec3d& operator=(
const vec2d& a );
258 vec3d& operator=(
double a );
259 vec3d& operator=(
const threed_point_type &a );
261 double& operator [] (
int i )
265 const double& operator [] (
int i )
const
300 vec3d& set_vec(
const std::vector<double> &a );
301 vec3d& set_arr(
const double a[] );
302 vec3d& set_arr(
const float a[] );
384 void get_pnt(
double pnt[3] )
const
390 void get_pnt(
float pnt[3] )
const
392 pnt[0] = ( float )v[0];
393 pnt[1] = ( float )v[1];
394 pnt[2] = ( float )v[2];
396 void get_pnt( threed_point_type &pnt )
const
553 void rotate_x(
double cos_alpha,
double sin_alpha )
557 v[1] = cos_alpha * v[1] + sin_alpha * v[2];
558 v[2] = -sin_alpha * old_y + cos_alpha * v[2];
592 void rotate_y(
double cos_alpha,
double sin_alpha )
596 v[0] = cos_alpha * v[0] - sin_alpha * v[2];
597 v[2] = sin_alpha * old_x + cos_alpha * v[2];
631 void rotate_z(
double cos_alpha,
double sin_alpha )
635 v[0] = cos_alpha * v[0] + sin_alpha * v[1];
636 v[1] = -sin_alpha * old_x + cos_alpha * v[1];
839 void offset_i(
double offset,
int idir )
854 v[0] = sin_alpha * v[1] + v[0];
855 v[1] = cos_alpha * v[1];
866 v[0] = cos_alpha * v[0];
867 v[1] = -sin_alpha * v[0] + v[1];
904 return(
vec3d( v[0], v[1], -v[2] ) );
937 return(
vec3d( v[0], -v[1], v[2] ) );
970 return(
vec3d( -v[0], v[1], v[2] ) );
973 vec3d swap_xy()
const
975 return(
vec3d( v[1], v[0], v[2] ) );
977 vec3d swap_xz()
const
979 return(
vec3d( v[2], v[1], v[0] ) );
981 vec3d swap_yz()
const
983 return(
vec3d( v[0], v[2], v[1] ) );
995 vec3d& operator*=(
double b );
996 vec3d& operator+=(
double b[] );
997 vec3d& operator-=(
double b[] );
998 vec3d& operator+=(
float b[] );
999 vec3d& operator-=(
float b[] );
1003 friend bool operator==(
const vec3d &a,
const vec3d& b );
1004 friend bool operator!=(
const vec3d &a,
const vec3d& b );
1079 int major_comp()
const;
1080 int minor_comp()
const;
1084 bool isfinite()
const;
1091 friend double radius_of_circle(
const vec3d& p1,
const vec3d& p2,
const vec3d& p3 );
1092 friend void center_of_circle(
const vec3d& p1,
const vec3d& p2,
const vec3d& p3,
vec3d& center );
1093 friend double dist_pnt_2_plane(
const vec3d& org,
const vec3d& norm,
const vec3d& pnt );
1094 friend double dist_pnt_2_line(
const vec3d& line_pt1,
const vec3d& line_pt2,
const vec3d& pnt );
1096 friend vec3d proj_pnt_on_line_seg(
const vec3d& line_pt1,
const vec3d& line_pt2,
const vec3d& pnt );
1097 friend vec3d proj_pnt_on_ray(
const vec3d& line_pt1,
const vec3d& line_pt2,
const vec3d& pnt );
1098 friend vec3d proj_pnt_on_line(
const vec3d& line_pt1,
const vec3d& line_pt2,
const vec3d& pnt );
1100 friend vec3d proj_vec_to_plane(
const vec3d& vec,
const vec3d& norm );
1102 double& u,
double& w,
double& t );
1104 double& u,
double& w,
double& t );
1105 friend int plane_ray_intersect(
const vec3d& A,
const vec3d& B,
const vec3d& C,
const vec3d& D,
const vec3d& E,
double& t );
1106 friend int plane_ray_intersect(
const vec3d& orig,
const vec3d& norm,
const vec3d& D,
const vec3d& E,
double& t );
1108 friend double tetra_volume(
const vec3d& A,
const vec3d& B,
const vec3d& C );
1110 friend double poly_area(
const std::vector< vec3d > & pnt_vec );
1111 friend double dist3D_Segment_to_Segment(
const vec3d& S1P0,
const vec3d& S1P1,
const vec3d& S2P0,
const vec3d& S2P1 );
1112 friend double dist3D_Segment_to_Segment(
const vec3d& S1P0,
const vec3d& S1P1,
const vec3d& S2P0,
const vec3d& S2P1,
1113 double* Lt,
vec3d* Ln,
double* St,
vec3d* Sn );
1115 friend double pointLineDistSquared(
const vec3d & p,
const vec3d& lp0,
const vec3d& lp1,
double* t );
1116 friend double pointSegDistSquared(
const vec3d& p,
const vec3d& sp0,
const vec3d& sp1,
double* t );
1117 friend vec3d point_on_line(
const vec3d & lp0,
const vec3d & lp1,
const double & t );
1119 friend vec2d MapToPlane(
const vec3d & p,
const vec3d & planeOrig,
const vec3d & planeVec1,
const vec3d & planeVec2 );
1120 friend vec3d MapFromPlane(
const vec2d & uw,
const vec3d & planeOrig,
const vec3d & planeVec1,
const vec3d & planeVec2 );
1122 friend int plane_half_space(
const vec3d & planeOrig,
const vec3d & planeNorm,
const vec3d & pnt );
1124 friend bool line_line_intersect(
const vec3d & p1,
const vec3d & p2,
const vec3d & p3,
const vec3d & p4,
double* s,
double* t );
1130 friend void BilinearWeights(
const vec3d & p0,
const vec3d & p1,
const vec3d & p, std::vector< double > & weights );
1132 friend double pnt_tri_min_dist(
const vec3d & v0,
const vec3d & v1,
const vec3d & v2,
const vec3d & pnt );
1134 friend vec3d slerp(
const vec3d& a,
const vec3d& b,
const double &t );
1472string to_string(
const vec3d &v);
friend vec3d operator-(const vec3d &a, const vec3d &b)
void rotate_z_zero_x(double cos_alpha, double sin_alpha)
friend double dot(const vec3d &a, const vec3d &b)
vec3d & set_xyz(double xx, double yy, double zz)
void offset_z(double offset)
void scale_z(double scale)
friend double signed_angle(const vec3d &a, const vec3d &b, const vec3d &ref)
void offset_x(double offset)
void scale_y(double scale)
void rotate_z(double cos_alpha, double sin_alpha)
friend vec3d operator+(const vec3d &a, const vec3d &b)
friend vec3d operator*(const vec3d &a, double b)
friend vec3d operator/(const vec3d &a, double b)
void rotate_x(double cos_alpha, double sin_alpha)
friend vec3d operator*(const vec3d &a, const vec3d &b)
friend vec3d cross(const vec3d &a, const vec3d &b)
void rotate_z_zero_y(double cos_alpha, double sin_alpha)
friend double angle(const vec3d &a, const vec3d &b)
void offset_y(double offset)
void scale_x(double scale)
friend double dist(const vec3d &a, const vec3d &b)
void rotate_y(double cos_alpha, double sin_alpha)
friend double cos_angle(const vec3d &a, const vec3d &b)
friend vec3d RotateArbAxis(const vec3d &p, double theta, const vec3d &r)
friend double dist_squared(const vec3d &a, const vec3d &b)
vec3d operator-(const vec3d &a, const vec3d &b)
double dot(const vec3d &a, const vec3d &b)
double signed_angle(const vec3d &a, const vec3d &b, const vec3d &ref)
vec3d operator+(const vec3d &a, const vec3d &b)
vec3d operator*(const vec3d &a, double b)
vec3d operator/(const vec3d &a, double b)
vec3d cross(const vec3d &a, const vec3d &b)
double angle(const vec3d &a, const vec3d &b)
double dist(const vec3d &a, const vec3d &b)
double cos_angle(const vec3d &a, const vec3d &b)
vec3d RotateArbAxis(const vec3d &p, double theta, const vec3d &r)
double dist_squared(const vec3d &a, const vec3d &b)