19 #pragma GCC optimize("O3") 23 #define HALF_SQRT_2 0.70710678118654757f 42 tmp =
x;
x = -y; y = tmp;
61 tmp =
x;
x = y; y = -tmp;
81 tmp =
x;
x = y; y = tmp; z = -z;
101 tmp =
x;
x = -y; y = -tmp; z = -z;
111 tmp = z; z = y; y = -tmp;
115 tmp = z; z = y; y = -tmp;
122 tmp = z; z = y; y = -tmp;
123 tmp =
x;
x = -y; y = tmp;
127 tmp = z; z = y; y = -tmp;
134 tmp = z; z = -y; y = tmp;
138 tmp = z; z = -y; y = tmp;
145 tmp = z; z = -y; y = tmp;
146 tmp =
x;
x = -y; y = tmp;
150 tmp = z; z = -y; y = tmp;
157 tmp = z; z = -
x;
x = tmp;
161 tmp = z; z =
x;
x = -tmp;
166 tmp = -
x;
x = -y; y = tmp;
171 tmp =
x;
x = y; y = -tmp;
175 tmp = z; z = y; y = -tmp;
176 tmp = z; z = -
x;
x = tmp;
181 tmp = z; z = -
x;
x = tmp;
185 tmp = z; z = -y; y = tmp;
186 tmp = z; z = -
x;
x = tmp;
190 tmp = z; z = y; y = -tmp;
195 tmp = z; z = -y; y = tmp;
200 tmp = z; z = y; y = -tmp;
201 tmp = z; z =
x;
x = -tmp;
206 tmp = z; z =
x;
x = -tmp;
210 tmp = z; z = -y; y = tmp;
211 tmp = z; z =
x;
x = -tmp;
215 tmp = z; z = y; y = -tmp;
217 tmp =
x;
x = -y; y = tmp;
221 tmp = z; z = y; y = -tmp;
222 tmp =
x;
x = y; y = -tmp;
229 x = 0.143039f * tmpx + 0.368776f * tmpy + -0.918446f * tmpz;
230 y = -0.332133f * tmpx + -0.856289f * tmpy + -0.395546f * tmpz;
231 z = -0.932324f * tmpx + 0.361625f * tmpy + 0.000000f * tmpz;
241 tmp = z; z = y; y = -tmp;
252 template <
typename T>
264 x_vec.
x, y_vec.
x, z_vec.
x,
265 x_vec.
y, y_vec.
y, z_vec.
y,
266 x_vec.
z, y_vec.
z, z_vec.
z 273 template <
typename T>
281 template <
typename T>
284 return x*v.
x + y*v.
y + z*v.
z;
287 template <
typename T>
290 return norm(
x, y, z);
293 template <
typename T>
300 template <
typename T>
307 template <
typename T>
310 x -= v.
x; y -= v.
y; z -= v.
z;
314 template <
typename T>
317 return isnan(
x) || isnan(y) || isnan(z);
320 template <
typename T>
323 return isinf(
x) || isinf(y) || isinf(z);
326 template <
typename T>
329 x+=v.
x; y+=v.
y; z+=v.
z;
333 template <
typename T>
339 template <
typename T>
345 template <
typename T>
351 template <
typename T>
357 template <
typename T>
363 template <
typename T>
369 template <
typename T>
375 template <
typename T>
378 float len = this->length() * v2.
length();
382 float cosv = ((*this)*v2) / len;
383 if (fabsf(cosv) >= 1) {
390 template <
typename T>
399 template <
typename T>
404 v1.
y * v2.
x, v1.
y * v2.
y, v1.
y * v2.
z,
405 v1.
z * v2.
x, v1.
z * v2.
y, v1.
z * v2.
z);
409 template <
typename T>
413 float a = (*
this-seg_start).length();
414 float b = (seg_start-seg_end).length();
415 float c = (seg_end-*
this).length();
418 if (fabsf(b) < FLT_EPSILON) {
423 float s = (a+b+c) * 0.5
f;
425 float area_squared = s*(s-a)*(s-b)*(s-c);
427 if (area_squared < 0.0
f) {
float norm(const T first, const U second, const Params... parameters)
float safe_sqrt(const T v)
float angle(const Vector3< T > &v2) const
Vector3< T > operator-(void) const
void rotate_inverse(enum Rotation rotation)
float distance_to_segment(const Vector3< T > &seg_start, const Vector3< T > &seg_end) const
Vector3< T > colz(void) const
bool operator!=(const Vector3< T > &v) const
Vector3< T > operator/(const T num) const
Vector3< T > coly(void) const
Vector3< T > & operator+=(const Vector3< T > &v)
Vector3< T > & operator/=(const T num)
Vector3< T > operator%(const Vector3< T > &v) const
Vector3< T > operator+(const Vector3< T > &v) const
bool operator==(const Vector3< T > &v) const
void rotate(enum Rotation rotation)
Vector3< T > mul_transpose(const Vector3< T > &v) const
std::enable_if< std::is_integral< typename std::common_type< Arithmetic1, Arithmetic2 >::type >::value,bool >::type is_equal(const Arithmetic1 v_1, const Arithmetic2 v_2)
Matrix3< T > mul_rowcol(const Vector3< T > &v) const
Vector3< T > & operator*=(const T num)
Vector3< T > colx(void) const
Vector3< T > & operator-=(const Vector3< T > &v)
Vector3< T > operator*(const T num) const