Easy3D 2.6.1
Loading...
Searching...
No Matches
types.h
1/********************************************************************
2 * Copyright (C) 2015-2021 by Liangliang Nan <liangliang.nan@gmail.com>
3 * Copyright (C) 2000-2005 INRIA - Project ALICE
4 *
5 * The code in this file is partly from OGF/Graphite (2.0 alpha-4) with
6 * modifications and enhancement:
7 * https://gforge.inria.fr/forum/forum.php?forum_id=11459
8 * The original code was distributed under the GNU GPL license.
9 ********************************************************************/
10
11#ifndef EASY3D_CORE_TYPES_H
12#define EASY3D_CORE_TYPES_H
13
14
15#include <cmath>
16#include <vector>
17#include <cstdint>
18
19#include <easy3d/core/vec.h>
20#include <easy3d/core/mat.h>
21#include <easy3d/core/rect.h>
22#include <easy3d/core/line.h>
23#include <easy3d/core/oriented_line.h>
24#include <easy3d/core/segment.h>
25#include <easy3d/core/plane.h>
26#include <easy3d/core/box.h>
27#include <easy3d/core/quat.h>
28#include <easy3d/core/polygon.h>
29#include <easy3d/core/constant.h>
30
36
37namespace easy3d {
38
39 //____________________ default types___________________
40
47
54
61
72
83
88
93
96
101
104
109
114
117
118
120 template <typename FT>
121 inline bool is_nan(FT v) {
122 return (std::isnan(v) || std::isinf(v));
123 }
124
128 template<class T>
129 inline T clamp(T x, T lower, T upper) {
130 return std::min(upper, std::max(x, lower));
131 }
132
142 inline int next_pow2(int a) {
143 int rval = 1;
144 while (rval < a) rval <<= 1;
145 return rval;
146 }
147
149 template<class FT>
150 inline FT truncate_digits(const FT &v, int num) {
151 FT tmp = std::pow(10.0, num);
152 auto des = static_cast<long long>((v < 0) ? (v * tmp - 0.5) : (v * tmp + 0.5));
153 return FT(des) / tmp;
154 }
155
156
159 namespace geom {
160
162 inline vec3 orthogonal(const vec3 &v) {
163 const float absx = std::fabs(v.x);
164 const float absy = std::fabs(v.y);
165 const float absz = std::fabs(v.z);
166 // Find smallest component. Keep equal case for null values.
167 if ((absy >= absx) && (absz >= absx))
168 return vec3(0.0f, -v.z, v.y);
169 else {
170 if ((absx >= absy) && (absz >= absy))
171 return vec3(-v.z, 0.0f, v.x);
172 else
173 return vec3(-v.y, v.x, 0.0f);
174 }
175 }
176
178 template<typename Box, typename Container>
179 inline Box bounding_box(const Container& points) {
180 Box result;
181 for (const auto& p : points) {
182 result.grow(p);
183 }
184 return result;
185 }
186
188 template<typename Vec, typename Container>
189 inline Vec centroid(const Container& points) {
190 Vec v(0);
191 for (const auto& p : points)
192 v += p;
193 return v / points.size();
194 }
195
197 template<typename Vec>
198 inline Vec barycenter(const Vec &p1, const Vec &p2) {
199 return (p1 + p2) * 0.5f;
200 }
201
203 template<typename Vec>
204 inline Vec barycenter(const Vec &p1, const Vec &p2, const Vec &p3) {
205 return (p1 + p2 + p3) / 3.0f;
206 }
207
209 template<typename Vec>
210 inline Vec barycenter(const Vec &p1, const Vec &p2, const Vec &p3, const Vec &p4) {
211 return (p1 + p2 + p3 + p4) * 0.25f;
212 }
213
216 template<typename FT>
218 const Vec<3, FT> &u,
219 const Vec<3, FT> &v,
220 const Vec<3, FT> &w);
221
226 inline bool point_in_polygon(const vec2 &p, const std::vector<vec2> &polygon);
227
229 inline double clamp_cot(const double v) {
230 const double bound = 19.1; // 3 degrees
231 return (v < -bound ? -bound : (v > bound ? bound : v));
232 }
233
235 inline double clamp_cos(const double v) {
236 const double bound = 0.9986; // 3 degrees
237 return (v < -bound ? -bound : (v > bound ? bound : v));
238 }
239
241 template<typename Vec>
242 inline double cos_angle(const Vec &a, const Vec &b) {
243 return dot(a, b) / std::sqrt(length2(a) * length2(b));
244 }
245
247 template<typename Vec>
248 inline double sin_angle(const Vec &a, const Vec &b) {
249 return norm(cross(a, b)) / (norm(a) * norm(b));
250 }
251
253 template<typename Vec>
254 inline typename Vec::FT cotan_angle(const Vec &a, const Vec &b) {
255 return clamp_cot(dot(a, b) / norm(cross(a, b)));
256 }
257
259 template<typename Vec>
260 inline double angle(const Vec &a, const Vec &b) {
261 return std::atan2(norm(cross(a, b)), dot(a, b));
262 }
263
265 template<typename FT>
266 inline FT to_radians(FT degrees) {
267 return degrees * static_cast<FT>(0.01745329251994329576923690768489);
268 }
269
271 template<typename FT>
272 inline FT to_degrees(FT radians) {
273 return radians * static_cast<FT>(57.295779513082320876798154814105);
274 }
275
277 inline float triangle_area(const vec3 &p1, const vec3 &p2, const vec3 &p3) {
278 return 0.5f * length(cross(p2 - p1, p3 - p1));
279 }
280
282 inline float triangle_signed_area(const vec2 &p1, const vec2 &p2, const vec2 &p3) {
283 return 0.5f * det(p2 - p1, p3 - p1);
284 }
285
287 inline vec3 triangle_normal(const vec3 &p1, const vec3 &p2, const vec3 &p3) {
288 vec3 n = cross(p2 - p1, p3 - p2);
289 return normalize(n);
290 }
291
293 inline float dist_point_line_segment(const vec3 &p, const vec3 &v0, const vec3 &v1, vec3 &nearest_point);
294
296 inline float
297 dist_point_triangle(const vec3 &p, const vec3 &v0, const vec3 &v1, const vec3 &v2, vec3 &nearest_point);
298
300 inline vec3 tetra_circum_center(const vec3& p, const vec3& q, const vec3& r, const vec3& s);
301
302 } // namespace geom
303
304
305 namespace color {
306
307 // Encode a color into an integer
308
310 inline int encode(int r, int g, int b) {
311 return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff);
312 }
313
315 inline int encode(int r, int g, int b, int a) {
316 return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff);
317 }
318
319 // Encode an integer into color components
320
322 inline void decode(int value, int &r, int &g, int &b) {
323 r = ((value >> 16) & 0xff);
324 g = ((value >> 8) & 0xff);
325 b = (value & 0xff);
326 }
327
329 inline void decode(int value, int &r, int &g, int &b, int &a) {
330 r = ((value >> 16) & 0xff);
331 g = ((value >> 8) & 0xff);
332 b = (value & 0xff);
333 a = (value >> 24);
334 }
335
336
337 // Given a color encoded as an integer, get the color component
338
340 inline int red(int color) { return ((color >> 16) & 0xff); }
341
343 inline int green(int color) { return ((color >> 8) & 0xff); }
344
346 inline int blue(int color) { return (color & 0xff); }
347
349 inline int alpha(int color) { return color >> 24; }
350
351 } // namespace color
352
353} // namespace easy3d
354
355
356//=============================================================================
357
358
359// \cond
360namespace easy3d {
361
362 namespace geom {
363
364 template<typename FT>
365 inline Vec<3, FT> barycentric_coordinates(const Vec<3, FT> &p,
366 const Vec<3, FT> &u,
367 const Vec<3, FT> &v,
368 const Vec<3, FT> &w) {
369 Vec<3, FT> result(1.0 / 3.0); // default: barycenter
370
371 Vec<3, FT> vu = v - u, wu = w - u, pu = p - u;
372
373 // find the largest absolute coordinate of normal
374 FT nx = vu[1] * wu[2] - vu[2] * wu[1],
375 ny = vu[2] * wu[0] - vu[0] * wu[2],
376 nz = vu[0] * wu[1] - vu[1] * wu[0], ax = fabs(nx), ay = fabs(ny),
377 az = fabs(nz);
378
379 unsigned char maxCoord;
380
381 if (ax > ay) {
382 if (ax > az)
383 maxCoord = 0;
384 else
385 maxCoord = 2;
386 } else {
387 if (ay > az)
388 maxCoord = 1;
389 else
390 maxCoord = 2;
391 }
392
393 // solve 2D problem
394 switch (maxCoord) {
395 case 0: {
396 if (1.0 + ax != 1.0) {
397 result[1] = 1.0 + (pu[1] * wu[2] - pu[2] * wu[1]) / nx - 1.0;
398 result[2] = 1.0 + (vu[1] * pu[2] - vu[2] * pu[1]) / nx - 1.0;
399 result[0] = 1.0 - result[1] - result[2];
400 }
401 break;
402 }
403
404 case 1: {
405 if (1.0 + ay != 1.0) {
406 result[1] = 1.0 + (pu[2] * wu[0] - pu[0] * wu[2]) / ny - 1.0;
407 result[2] = 1.0 + (vu[2] * pu[0] - vu[0] * pu[2]) / ny - 1.0;
408 result[0] = 1.0 - result[1] - result[2];
409 }
410 break;
411 }
412
413 case 2: {
414 if (1.0 + az != 1.0) {
415 result[1] = 1.0 + (pu[0] * wu[1] - pu[1] * wu[0]) / nz - 1.0;
416 result[2] = 1.0 + (vu[0] * pu[1] - vu[1] * pu[0]) / nz - 1.0;
417 result[0] = 1.0 - result[1] - result[2];
418 }
419 break;
420 }
421 default:
422 break;
423 }
424
425 return result;
426 }
427
428 //-----------------------------------------------------------------------------
429
430 inline bool point_in_polygon(const vec2 &p, const std::vector<vec2> &polygon) {
431 bool inside = false;
432 std::size_t n = polygon.size();
433 for (std::size_t i = 0, j = n - 1; i < n; j = i, ++i) {
434 const vec2 &u0 = polygon[i];
435 const vec2 &u1 = polygon[j]; // current edge
436
437 if (((u0.y <= p.y) && (p.y < u1.y)) || // U1 is above the ray, U0 is on or below the ray
438 ((u1.y <= p.y) && (p.y < u0.y))) // U0 is above the ray, U1 is on or below the ray
439 {
440 // find x-intersection of current edge with the ray.
441 // Only consider edge crossings on the ray to the right of P.
442 double x = u0.x + (p.y - u0.y) * (u1.x - u0.x) / (u1.y - u0.y);
443 if (x > p.x)
444 inside = !inside;
445 }
446 }
447
448 return inside;
449 }
450
451 //-----------------------------------------------------------------------------
452
453 inline float dist_point_line_segment(const vec3 &p, const vec3 &v0, const vec3 &v1, vec3 &nearest_point) {
454 vec3 d1(p - v0);
455 vec3 d2(v1 - v0);
456 vec3 min_v(v0);
457 float t = dot(d2, d2);
458
459 if (t > FLT_MIN) {
460 t = dot(d1, d2) / t;
461 if (t > 1.0)
462 d1 = p - (min_v = v1);
463 else if (t > 0.0)
464 d1 = p - (min_v = v0 + d2 * t);
465 }
466
467 nearest_point = min_v;
468 return norm(d1);
469 }
470
471 //-----------------------------------------------------------------------------
472
473 inline float
474 dist_point_triangle(const vec3 &p, const vec3 &v0, const vec3 &v1, const vec3 &v2, vec3 &nearest_point) {
475 vec3 v0v1 = v1 - v0;
476 vec3 v0v2 = v2 - v0;
477 vec3 n = cross(v0v1, v0v2); // not normalized !
478 float len2 = length2(n);
479
480 // Check if the triangle is degenerated -> measure dist to line segments
481 if (fabs(len2) < FLT_MIN) {
482 vec3 q, qq;
483 float dd = dist_point_line_segment(p, v0, v1, qq);
484 float d = dist_point_line_segment(p, v1, v2, q);
485 if (d < dd) {
486 dd = d;
487 qq = q;
488 }
489
490 d = dist_point_line_segment(p, v2, v0, q);
491 if (d < dd) {
492 dd = d;
493 qq = q;
494 }
495
496 nearest_point = qq;
497 return dd;
498 }
499
500 float inv_d = 1.0f / len2;
501 vec3 v1v2 = v2;
502 v1v2 -= v1;
503 vec3 v0p = p;
504 v0p -= v0;
505 vec3 t = cross(v0p, n);
506 float a = dot(t, v0v2) * -inv_d;
507 float b = dot(t, v0v1) * inv_d;
508 float s01, s02, s12;
509
510 // Calculate the distance to an edge or a corner vertex
511 if (a < 0) {
512 s02 = dot(v0v2, v0p) / length2(v0v2);
513 if (s02 < 0.0) {
514 s01 = dot(v0v1, v0p) / length2(v0v1);
515 if (s01 <= 0.0) {
516 v0p = v0;
517 } else if (s01 >= 1.0) {
518 v0p = v1;
519 } else {
520 (v0p = v0) += (v0v1 *= s01);
521 }
522 } else if (s02 > 1.0) {
523 s12 = dot(v1v2, (p - v1)) / length2(v1v2);
524 if (s12 >= 1.0) {
525 v0p = v2;
526 } else if (s12 <= 0.0) {
527 v0p = v1;
528 } else {
529 (v0p = v1) += (v1v2 *= s12);
530 }
531 } else {
532 (v0p = v0) += (v0v2 *= s02);
533 }
534 }
535
536 // Calculate the distance to an edge or a corner vertex
537 else if (b < 0.0) {
538 s01 = dot(v0v1, v0p) / length2(v0v1);
539 if (s01 < 0.0) {
540 s02 = dot(v0v2, v0p) / length2(v0v2);
541 if (s02 <= 0.0) {
542 v0p = v0;
543 } else if (s02 >= 1.0) {
544 v0p = v2;
545 } else {
546 (v0p = v0) += (v0v2 *= s02);
547 }
548 } else if (s01 > 1.0) {
549 s12 = dot(v1v2, (p - v1)) / length2(v1v2);
550 if (s12 >= 1.0) {
551 v0p = v2;
552 } else if (s12 <= 0.0) {
553 v0p = v1;
554 } else {
555 (v0p = v1) += (v1v2 *= s12);
556 }
557 } else {
558 (v0p = v0) += (v0v1 *= s01);
559 }
560 }
561
562 // Calculate the distance to an edge or a corner vertex
563 else if (a + b > 1.0) {
564 s12 = dot(v1v2, (p - v1)) / length2(v1v2);
565 if (s12 >= 1.0) {
566 s02 = dot(v0v2, v0p) / length2(v0v2);
567 if (s02 <= 0.0) {
568 v0p = v0;
569 } else if (s02 >= 1.0) {
570 v0p = v2;
571 } else {
572 (v0p = v0) += (v0v2 *= s02);
573 }
574 } else if (s12 <= 0.0) {
575 s01 = dot(v0v1, v0p) / length2(v0v1);
576 if (s01 <= 0.0) {
577 v0p = v0;
578 } else if (s01 >= 1.0) {
579 v0p = v1;
580 } else {
581 (v0p = v0) += (v0v1 *= s01);
582 }
583 } else {
584 (v0p = v1) += (v1v2 *= s12);
585 }
586 }
587
588 // Calculate the distance to an interior point of the triangle
589 else {
590 n *= (dot(n, v0p) * inv_d);
591 (v0p = p) -= n;
592 }
593
594 nearest_point = v0p;
595 v0p -= p;
596 return norm(v0p);
597 }
598
599
600 inline vec3 tetra_circum_center(const vec3 &p, const vec3 &q, const vec3 &r, const vec3 &s) {
601 vec3 qp = q - p;
602 float qp2 = length2(qp);
603 vec3 rp = r - p;
604 float rp2 = length2(rp);
605 vec3 sp = s - p;
606 float sp2 = length2(sp);
607
608 double num_x = determinant(mat3(
609 qp.y, qp.z, qp2,
610 rp.y, rp.z, rp2,
611 sp.y, sp.z, sp2)
612 );
613 double num_y = determinant(mat3(
614 qp.x, qp.z, qp2,
615 rp.x, rp.z, rp2,
616 sp.x, sp.z, sp2)
617 );
618 double num_z = determinant(mat3(
619 qp.x, qp.y, qp2,
620 rp.x, rp.y, rp2,
621 sp.x, sp.y, sp2)
622 );
623 double den = determinant(mat3(
624 qp.x, qp.y, qp.z,
625 rp.x, rp.y, rp.z,
626 sp.x, sp.y, sp.z)
627 );
628
629 assert(std::abs(den) > 1e-30f);
630
631 den *= 2.0f;
632
633 return vec3(
634 p.x + float(num_x / den),
635 p.y - float(num_y / den),
636 p.z + float(num_z / den)
637 );
638
639 }
640
641 } // namespace geom
642
643} // namespace easy3d
644// \endcond
645
646#endif // EASY3D_CORE_TYPES_H
647
648
GenericBox represents the bounding box of shapes.
Definition box.h:45
A generic line representation, which supports both 2D and 3D lines.
Definition line.h:45
OrientedLine implements plucker coordinates, which enables oriented lines to be compared.
Definition oriented_line.h:43
A 3D Plane of equation a*x + b*y + c*z + d = 0.
Definition plane.h:43
A 2D polygon representation.
Definition polygon.h:43
The GenericRect class defines a rectangle in the 2D space, where the origin of the coordinate system ...
Definition rect.h:45
A generic segmentation representation, which supports both 2D and 3D line segments.
Definition segment.h:46
2 by 2 matrix. Extends Mat with 2D-specific functionality and constructors.
Definition mat.h:1673
3 by 3 matrix. Extends Mat with 3D-specific functionality and constructors.
Definition mat.h:1844
4 by 4 matrix. Extends Mat with 4D-specific functionality and constructors.
Definition mat.h:2180
Base class for matrix types.
Definition mat.h:64
The Quaternion class represents 3D rotations and orientations.
Definition quat.h:107
Base class for vector types. It provides generic functionality for N dimensional vectors.
Definition vec.h:30
Functions for basic geometric computations.
Definition surface_mesh_geometry.cpp:21
FT to_radians(FT degrees)
Converts an angle from degrees to radians.
Definition types.h:266
vec3 centroid(const SurfaceMesh *mesh, SurfaceMesh::Face f)
Compute the barycenter/centroid of a face.
Definition surface_mesh_geometry.cpp:72
vec3 triangle_normal(const vec3 &p1, const vec3 &p2, const vec3 &p3)
Computes the normal vector of a triangle given by three points.
Definition types.h:287
double sin_angle(const Vec &a, const Vec &b)
Computes sine of angle between two (un-normalized) vectors.
Definition types.h:248
double cos_angle(const Vec &a, const Vec &b)
Computes cosine of angle between two (un-normalized) vectors.
Definition types.h:242
double angle(const Vec &a, const Vec &b)
Computes angle between two (un-normalized) vectors.
Definition types.h:260
Vec< 3, FT > barycentric_coordinates(const Vec< 3, FT > &p, const Vec< 3, FT > &u, const Vec< 3, FT > &v, const Vec< 3, FT > &w)
Computes the barycentric coordinates of a point p with respect to three points u, v,...
float triangle_area(const SurfaceMesh *mesh, SurfaceMesh::Face f)
Compute the area of a triangle face in a mesh.
Definition surface_mesh_geometry.cpp:23
Vec::FT cotan_angle(const Vec &a, const Vec &b)
Computes cotangent of angle between two (un-normalized) vectors.
Definition types.h:254
float dist_point_triangle(const vec3 &p, const vec3 &v0, const vec3 &v1, const vec3 &v2, vec3 &nearest_point)
Computes the distance of a point p to the triangle given by vec3s (v0, v1, v2).
bool point_in_polygon(const vec2 &p, const std::vector< vec2 > &polygon)
Tests if a point p lies inside or outside of a polygon. This function is robust to handle general pol...
float triangle_signed_area(const vec2 &p1, const vec2 &p2, const vec2 &p3)
Computes signed area of a triangle given by three points.
Definition types.h:282
FT to_degrees(FT radians)
Converts an angle from radians to degrees.
Definition types.h:272
float dist_point_line_segment(const vec3 &p, const vec3 &v0, const vec3 &v1, vec3 &nearest_point)
Computes the distance of a point p to a line segment given by vec3s (v0,v1).
Vec barycenter(const Vec &p1, const Vec &p2)
Computes the barycenter of two points.
Definition types.h:198
double clamp_cos(const double v)
Clamps cosine values as if angles are in [1, 179].
Definition types.h:235
vec3 tetra_circum_center(const vec3 &p, const vec3 &q, const vec3 &r, const vec3 &s)
Computes the circum center of a tetrahedron.
double clamp_cot(const double v)
Clamps cotangent values as if angles are in [1, 179].
Definition types.h:229
Box bounding_box(const Container &points)
Computes the bounding box of a set of points.
Definition types.h:179
vec3 orthogonal(const vec3 &v)
Returns a vector orthogonal to v. Its norm() depends on v, but is zero only for a null v.
Definition types.h:162
Definition collider.cpp:182
Mat2< double > dmat2
A 2 by 2 matrix of double type.
Definition types.h:74
Mat< 4, 3, float > mat43
A 4 by 3 matrix of float type.
Definition types.h:71
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
Mat< 3, 4, double > dmat34
A 3 by 4 matrix of double type.
Definition types.h:80
GenericOrientedLine< float > OrientedLine3
A 3D oriented line of float type.
Definition types.h:95
bool is_nan(FT v)
Is this NaN?
Definition types.h:121
Vec< N, T > normalize(const Vec< N, T > &v)
Computes and returns the normalized vector (Note: the input vector is not modified).
Definition vec.h:299
GenericPolygon< float > Polygon2
A 2D polygon of float type.
Definition types.h:116
T length(const Vec< N, T > &v)
Computes the length/magnitude of a vector.
Definition vec.h:289
GenericRect< float > Rect
A 2D axis-aligned rectangle of float type.
Definition types.h:111
T clamp(T x, T lower, T upper)
Clamps a num to be within a given range.
Definition types.h:129
Vec< 3, T > cross(const Vec< 3, T > &v1, const Vec< 3, T > &v2)
Compute the cross product of two 3D vectors.
Definition vec.h:685
GenericBox< 2, float > Box2
A 2D axis-aligned bounding box of float type.
Definition types.h:106
Vec< 3, double > dvec3
A 3D point/vector of double type.
Definition types.h:51
Vec< 2, int32_t > ivec2
A 2D point/vector of int32_t type.
Definition types.h:56
Mat4< double > dmat4
A 4 by 4 matrix of double type.
Definition types.h:78
Vec< 4, int32_t > ivec4
A 4D point/vector of int32_t type.
Definition types.h:60
GenericBox< 3, float > Box3
A 3D axis-aligned bounding box of float type.
Definition types.h:108
T determinant(const Mat< N, N, T > &m)
Computes the determinant of a square matrix.
Definition mat.h:1143
Vec< 2, double > dvec2
A 2D point/vector of double type.
Definition types.h:49
GenericRect< int32_t > iRect
A 2D axis-aligned rectangle of int32_t type.
Definition types.h:113
Quat< float > quat
A quaternion of float type.
Definition types.h:85
Mat2< float > mat2
A 2 by 2 matrix of float type.
Definition types.h:63
int next_pow2(int a)
Calculates the next larger power of 2. If the input is already a power of 2, it will return itself.
Definition types.h:142
FT truncate_digits(const FT &v, int num)
Rounds the given floating point number v to have num digits.
Definition types.h:150
GenericPlane< float > Plane3
A 3D plane of float type.
Definition types.h:103
Vec< 3, int32_t > ivec3
A 3D point/vector of int32_t type.
Definition types.h:58
GenericLine< 3, float > Line3
A 3D line of float type.
Definition types.h:92
GenericSegment< 3, float > Segment3
A 3D line segment of float type.
Definition types.h:100
T det(const Vec< 2, T > &v1, const Vec< 2, T > &v2)
Compute the determinant of the 2x2 matrix formed by the two 2D vectors as the two rows.
Definition vec.h:481
T length2(const Vec< N, T > &v)
Computes the squared length/magnitude of a vector.
Definition vec.h:293
Quat< double > dquat
A quaternion of double type.
Definition types.h:87
Mat4< float > mat4
A 4 by 4 matrix of float type.
Definition types.h:67
Mat3< float > mat3
A 3 by 3 matrix of float type.
Definition types.h:65
Vec< 4, float > vec4
A 4D point/vector of float type.
Definition types.h:46
Mat3< double > dmat3
A 3 by 3 matrix of double type.
Definition types.h:76
Vec< 2, float > vec2
A 2D point/vector of float type.
Definition types.h:42
GenericSegment< 2, float > Segment2
A 2D line segment of float type.
Definition types.h:98
GenericLine< 2, float > Line2
A 2D line of float type.
Definition types.h:90
FT dot(const std::vector< FT > &, const std::vector< FT > &)
Inner product for vectors.
Definition matrix.h:1834
Vec< 4, double > dvec4
A 4D point/vector of double type.
Definition types.h:53
Mat< 4, 3, double > dmat43
A 4 by 3 matrix of double type.
Definition types.h:82
FT norm(const Matrix< FT > &)
utilities
Definition matrix.h:1455
Mat< 3, 4, float > mat34
A 3 by 4 matrix of float type.
Definition types.h:69