29 v[1 - 1] = a; v[2 - 1] = a;
34 v[1 - 1] = v_1; v[2 - 1] = v_2;
39 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1];
44 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1];
49 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1];
61 inline bool is_zero()
const {
return (v[0] == 0.0 && v[1] == 0.0); }
63 return (fabs(v[0]) <= tiny_tol && fabs(v[1]) <= tiny_tol);
110 for(
int i = 0; i < 2;++i) { c[i] = a[i] + b[i]; }
117 for(
int i = 0; i < 2;++i) { c[i] = a + b[i]; }
124 for(
int i = 0; i < 2;++i) { c[i] = a[i] + b; }
133 for(
int i = 0; i < 2;++i) { c[i] = a[i] - b[i]; }
140 for(
int i = 0; i < 2;++i) { c[i] = a - b[i]; }
147 for(
int i = 0; i < 2;++i) { c[i] = a[i] - b; }
156 for(
int i = 0; i < 2;++i) { c[i] = a[i] * b[i]; }
163 for(
int i = 0; i < 2;++i) { c[i] = a * b[i]; }
170 for(
int i = 0; i < 2;++i) { c[i] = a[i] * b; }
179 for(
int i = 0; i < 2;++i) { c[i] = a[i] / b[i]; }
186 for(
int i = 0; i < 2;++i) { c[i] = a / b[i]; }
193 for(
int i = 0; i < 2;++i) { c[i] = a[i] / b; }
256 for(
int i = 0; i < 2;++i) { c = c && a[i] == b[i]; }
263 for(
int i = 0; i < 2;++i) { c = c && a == b[i]; }
270 for(
int i = 0; i < 2;++i) { c = c && a[i] == b; }
279 for(
int i = 0; i < 2;++i) { c = c && a[i] < b[i]; }
286 for(
int i = 0; i < 2;++i) { c = c && a < b[i]; }
293 for(
int i = 0; i < 2;++i) { c = c && a[i] < b; }
302 for(
int i = 0; i < 2;++i) { c = c && a[i] <= b[i]; }
309 for(
int i = 0; i < 2;++i) { c = c && a <= b[i]; }
316 for(
int i = 0; i < 2;++i) { c = c && a[i] <= b; }
325 for(
int i = 0; i < 2;++i) { c = c && a[i] > b[i]; }
332 for(
int i = 0; i < 2;++i) { c = c && a > b[i]; }
339 for(
int i = 0; i < 2;++i) { c = c && a[i] > b; }
348 for(
int i = 0; i < 2;++i) { c = c && a[i] >= b[i]; }
355 for(
int i = 0; i < 2;++i) { c = c && a >= b[i]; }
362 for(
int i = 0; i < 2;++i) { c = c && a[i] >= b; }
372 for(
int i = 0; i < 2;++i) { c[i] = - a[i]; }
396 return sqrt(
inner(a, a));
426 return inner(a, u) * u;
431 return vec2(fabs(val[0]), fabs(val[1]));
451 v[1 - 1] = a; v[2 - 1] = a; v[3 - 1] = a;
456 v[1 - 1] = v_1; v[2 - 1] = v_2; v[3 - 1] = v_3;
461 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1]; v[3 - 1] = a[3 - 1];
466 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1]; v[3 - 1] = a[3 - 1];
471 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1]; v[3 - 1] = a[3 - 1];
480 inline bool is_zero()
const {
return (v[0] == 0.0 && v[1] == 0.0 && v[2] == 0.0); }
482 return (fabs(v[0]) <= tiny_tol && fabs(v[1]) <= tiny_tol && fabs(v[2]) <= tiny_tol );
529 for(
int i = 0; i < 3;++i) { c[i] = a[i] + b[i]; }
536 for(
int i = 0; i < 3;++i) { c[i] = a + b[i]; }
543 for(
int i = 0; i < 3;++i) { c[i] = a[i] + b; }
552 for(
int i = 0; i < 3;++i) { c[i] = a[i] - b[i]; }
559 for(
int i = 0; i < 3;++i) { c[i] = a - b[i]; }
566 for(
int i = 0; i < 3;++i) { c[i] = a[i] - b; }
575 for(
int i = 0; i < 3;++i) { c[i] = a[i] * b[i]; }
582 for(
int i = 0; i < 3;++i) { c[i] = a * b[i]; }
589 for(
int i = 0; i < 3;++i) { c[i] = a[i] * b; }
598 for(
int i = 0; i < 3;++i) { c[i] = a[i] / b[i]; }
605 for(
int i = 0; i < 3;++i) { c[i] = a / b[i]; }
612 for(
int i = 0; i < 3;++i) { c[i] = a[i] / b; }
673 for(
int i = 0; i < 3;++i) { c = c && a[i] == b[i]; }
680 for(
int i = 0; i < 3;++i) { c = c && a == b[i]; }
687 for(
int i = 0; i < 3;++i) { c = c && a[i] == b; }
696 for(
int i = 0; i < 3;++i) { c = c && a[i] < b[i]; }
703 for(
int i = 0; i < 3;++i) { c = c && a < b[i]; }
710 for(
int i = 0; i < 3;++i) { c = c && a[i] < b; }
719 for(
int i = 0; i < 3;++i) { c = c && a[i] <= b[i]; }
726 for(
int i = 0; i < 3;++i) { c = c && a <= b[i]; }
733 for(
int i = 0; i < 3;++i) { c = c && a[i] <= b; }
742 for(
int i = 0; i < 3;++i) { c = c && a[i] > b[i]; }
749 for(
int i = 0; i < 3;++i) { c = c && a > b[i]; }
756 for(
int i = 0; i < 3;++i) { c = c && a[i] > b; }
765 for(
int i = 0; i < 3;++i) { c = c && a[i] >= b[i]; }
772 for(
int i = 0; i < 3;++i) { c = c && a >= b[i]; }
779 for(
int i = 0; i < 3;++i) { c = c && a[i] >= b; }
789 for(
int i = 0; i < 3;++i) { c[i] = - a[i]; }
795 return vec3(fabs(val[0]), fabs(val[1]), fabs(val[2]));
826 return sqrt(
inner(a, a));
852 return inner(a, u) * u;
871 v[1 - 1] = a; v[2 - 1] = a; v[3 - 1] = a; v[4 - 1] = a;
876 v[1 - 1] = v_1; v[2 - 1] = v_2; v[3 - 1] = v_3; v[4 - 1] = v_4;
881 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1]; v[3 - 1] = a[3 - 1]; v[4 - 1] = a[4 - 1];
886 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1]; v[3 - 1] = a[3 - 1]; v[4 - 1] = a[4 - 1];
891 v[1 - 1] = a[1 - 1]; v[2 - 1] = a[2 - 1]; v[3 - 1] = a[3 - 1]; v[4 - 1] = a[4 - 1];
900 inline bool is_zero()
const {
return (v[0] == 0.0 && v[1] == 0.0 && v[2] == 0.0 && v[3] == 0.0); }
902 return (fabs(v[0]) <= tiny_tol && fabs(v[1]) <= tiny_tol && fabs(v[2]) <= tiny_tol && fabs(v[3]) <= tiny_tol);
919 for(
int i = 0; i < 4;++i) { c[i] = a[i] + b[i]; }
926 for(
int i = 0; i < 4;++i) { c[i] = a + b[i]; }
933 for(
int i = 0; i < 4;++i) { c[i] = a[i] + b; }
942 for(
int i = 0; i < 4;++i) { c[i] = a[i] - b[i]; }
949 for(
int i = 0; i < 4;++i) { c[i] = a - b[i]; }
956 for(
int i = 0; i < 4;++i) { c[i] = a[i] - b; }
965 for(
int i = 0; i < 4;++i) { c[i] = a[i] * b[i]; }
972 for(
int i = 0; i < 4;++i) { c[i] = a * b[i]; }
979 for(
int i = 0; i < 4;++i) { c[i] = a[i] * b; }
988 for(
int i = 0; i < 4;++i) { c[i] = a[i] / b[i]; }
995 for(
int i = 0; i < 4;++i) { c[i] = a / b[i]; }
1002 for(
int i = 0; i < 4;++i) { c[i] = a[i] / b; }
1065 for(
int i = 0; i < 4;++i) { c = c && a[i] == b[i]; }
1072 for(
int i = 0; i < 4;++i) { c = c && a == b[i]; }
1079 for(
int i = 0; i < 4;++i) { c = c && a[i] == b; }
1088 for(
int i = 0; i < 4;++i) { c = c && a[i] < b[i]; }
1095 for(
int i = 0; i < 4;++i) { c = c && a < b[i]; }
1102 for(
int i = 0; i < 4;++i) { c = c && a[i] < b; }
1111 for(
int i = 0; i < 4;++i) { c = c && a[i] <= b[i]; }
1118 for(
int i = 0; i < 4;++i) { c = c && a <= b[i]; }
1125 for(
int i = 0; i < 4;++i) { c = c && a[i] <= b; }
1134 for(
int i = 0; i < 4;++i) { c = c && a[i] > b[i]; }
1141 for(
int i = 0; i < 4;++i) { c = c && a > b[i]; }
1148 for(
int i = 0; i < 4;++i) { c = c && a[i] > b; }
1157 for(
int i = 0; i < 4;++i) { c = c && a[i] >= b[i]; }
1164 for(
int i = 0; i < 4;++i) { c = c && a >= b[i]; }
1171 for(
int i = 0; i < 4;++i) { c = c && a[i] >= b; }
1181 for(
int i = 0; i < 4;++i) { c[i] = - a[i]; }
1187 return vec4(fabs(val[0]), fabs(val[1]), fabs(val[2]), fabs(val[3]));
1217 return sqrt(
inner(a, a));
1243 return inner(a, u) * u;
int scan(FILE *fp, const vec2 &v)
real inner(const vec2 &a, const vec2 &b)
structure for 2-dimensional real type vector and its arithmetic.
ivec2 operator*=(ivec2 &a, const ivec2 &b)
vec2 absolute(const vec2 &val)
int is_parallel(const vec2 &, real=angle_tolerance) const
vec2 operator/(const vec2 &a, const vec2 &b)
ivec2 operator+=(ivec2 &a, const ivec2 &b)
ivec2 operator+(const ivec2 &a, const ivec2 &b)
vec4 & operator=(const vec4 &a)
vec3 & operator=(const vec3 &a)
structure for 4-dimensional real type vector and its arithmetic.
structure for 4-dimensional integer vector and its arithmetic.
ivec2 operator*(const ivec2 &a, const ivec2 &b)
structure for 2-dimensional integer vector and its arithmetic.
bool is_tiny(real tiny_tol=epsilon) const
int operator<=(const ivec2 &a, const ivec2 &b)
real angle(const vec2 &a, const vec2 &b)
vec3 cross(const vec3 &a, const vec3 &b)
bool perpendicular(const vec2 &)
vec2 & operator=(const vec2 &a)
structure for 3-dimensional real type vector and its arithmetic.
vec2 proj(const vec2 &axis, const vec2 &a)
structure for 3-dimensional integer vector and its arithmetic.
real squaredNorm(const vec2 &a)
int operator>=(const ivec2 &a, const ivec2 &b)
bool is_tiny(real tiny_tol=epsilon) const
int apx_equal(real x, real y)
vec3(real v_1, real v_2, real v_3)
ivec2 operator-=(ivec2 &a, const ivec2 &b)
int operator<(const ivec2 &a, const ivec2 &b)
int operator>(const ivec2 &a, const ivec2 &b)
vec2 operator/=(vec2 &a, const vec2 &b)
ivec2 operator-(const ivec2 &a, const ivec2 &b)
int operator==(const ivec2 &a, const ivec2 &b)
bool is_tiny(real tiny_tol=epsilon) const
void store(FILE *fp, const vec2 &v)
vec4(real v_1, real v_2, real v_3, real v_4)
bool is_perpendicular(const vec2 &, real=angle_tolerance) const