wykobi.hpp
Go to the documentation of this file.
1 /*
2 (***********************************************************************)
3 (* *)
4 (* Wykobi Computational Geometry Library *)
5 (* Release Version 0.0.5 *)
6 (* http://www.wykobi.com *)
7 (* Copyright (c) 2005-2017 Arash Partow, All Rights Reserved. *)
8 (* *)
9 (* The Wykobi computational geometry library and its components are *)
10 (* supplied under the terms of the open source MIT License. *)
11 (* The contents of the Wykobi computational geometry library and its *)
12 (* components may not be copied or disclosed except in accordance with *)
13 (* the terms of the MIT License. *)
14 (* *)
15 (* URL: https://opensource.org/licenses/MIT *)
16 (* *)
17 (***********************************************************************)
18 */
19 
20 #ifndef INCLUDE_WYKOBI
21 #define INCLUDE_WYKOBI
22 
23 #include <algorithm>
24 #include <cassert>
25 #include <cstddef>
26 #include <iterator>
27 #include <limits>
28 #include <vector>
29 
30 #include "wykobi_math.hpp"
31 
32 namespace wykobi {
33 
34 static const char VERSION_INFORMATION[] = "Wykobi Version 0.0.5";
35 static const char AUTHOR_INFORMATION[] = "Arash Partow";
36 static const char EPOCH_VERSION[] = "C578AC5A:35A4123B:DF32F721";
37 
38 #ifndef WYKOBI
39 #define WYKOBI
40 #endif
41 
42 /****************************************************************************/
43 /********************[ Basic Geometric Structure Types ]*********************/
44 /****************************************************************************/
45 
46 /************[ Geometric Entity ]*************/
48 
65  eSphere
66 };
67 
68 /**************[ Vertex type ]***************/
69 
70 template <typename T, std::size_t D>
71 class pointnd;
72 
73 template <typename T = Float>
74 class point2d : public geometric_entity {
75  public:
76  typedef T type;
77  typedef const type& const_reference;
78  typedef type& reference;
79 
80  point2d() : x(T(0.0)), y(T(0.0)) {}
81  point2d(const pointnd<T, 2>& point) : x(point[0]), y(point[1]) {}
82  ~point2d() {}
83 
84  inline point2d<T>& operator=(const pointnd<T, 2>& point) {
85  x = point[0];
86  y = point[1];
87  return *this;
88  }
89 
90  inline reference operator()(const std::size_t& index) {
91  return ((0 == index) ? x : y);
92  }
93  inline const_reference operator()(const std::size_t& index) const {
94  return ((0 == index) ? x : y);
95  }
96 
97  inline reference operator[](const std::size_t& index) {
98  return ((0 == index) ? x : y);
99  }
100  inline const_reference operator[](const std::size_t& index) const {
101  return ((0 == index) ? x : y);
102  }
103 
104  T x, y;
105 };
106 
107 template <typename T = Float>
108 class point3d : public geometric_entity {
109  public:
110  typedef T Type;
111  typedef const Type& const_reference;
112  typedef Type& reference;
113 
114  point3d() : x(T(0.0)), y(T(0.0)), z(T(0.0)) {}
115  point3d(const pointnd<T, 3>& point) : x(point[0]), y(point[1]), z(point[2]) {}
116  ~point3d() {}
117 
118  inline point3d<T>& operator=(const pointnd<T, 3>& point) {
119  x = point[0];
120  y = point[1];
121  z = point[2];
122  return *this;
123  }
124 
125  inline reference operator()(const std::size_t& index) { return value(index); }
126  inline const_reference operator()(const std::size_t& index) const {
127  return value(index);
128  }
129 
130  inline reference operator[](const std::size_t& index) { return value(index); }
131  inline const_reference operator[](const std::size_t& index) const {
132  return value(index);
133  }
134 
135  T x, y, z;
136 
137  private:
138  inline reference value(const std::size_t& index) {
139  switch (index) {
140  case 0:
141  return x;
142  case 1:
143  return y;
144  case 2:
145  return z;
146  default:
147  return x;
148  }
149  }
150 
151  inline const_reference value(const std::size_t& index) const {
152  switch (index) {
153  case 0:
154  return x;
155  case 1:
156  return y;
157  case 2:
158  return z;
159  default:
160  return x;
161  }
162  }
163 };
164 
165 template <typename T, std::size_t D>
166 class pointnd : public geometric_entity {
167  public:
168  typedef const T& const_reference;
169  typedef T& reference;
170 
171  pointnd() { clear(); }
172  pointnd(const T& v0) { v[0] = v0; }
173  pointnd(const T& v0, const T& v1) {
174  v[0] = v0;
175  v[1] = v1;
176  }
177  pointnd(const T& v0, const T& v1, const T& v2) {
178  v[0] = v0;
179  v[1] = v1;
180  v[2] = v2;
181  }
182  pointnd(const T& v0, const T& v1, const T& v2, const T& v3) {
183  v[0] = v0;
184  v[1] = v1;
185  v[2] = v2;
186  v[3] = v3;
187  }
188  pointnd(const pointnd<T, D>& point) {
189  for (std::size_t i = 0; i < D; ++i) v[i] = point.v[i];
190  }
191 
192  pointnd(const point2d<T>& point) {
193  for (std::size_t i = 0; i < D; ++i) v[i] = point[i];
194  }
195 
196  pointnd(const point3d<T>& point) {
197  for (std::size_t i = 0; i < D; ++i) v[i] = point[i];
198  }
199 
200  ~pointnd() {}
201 
202  void clear() {
203  for (std::size_t i = 0; i < D; ++i) v[i] = T(0.0);
204  }
205 
206  inline pointnd<T, D>& operator=(const pointnd<T, D>& point) {
207  if (this == &point) return *this;
208  for (std::size_t i = 0; i < D; ++i) v[i] = point.v[i];
209  return *this;
210  }
211 
212  inline pointnd<T, D>& operator=(const point2d<T>& point) {
213  if (D == 2) {
214  v[0] = point.x;
215  v[1] = point.y;
216  }
217  return *this;
218  }
219 
220  inline pointnd<T, D>& operator=(const point3d<T>& point) {
221  if (D == 3) {
222  v[0] = point.x;
223  v[1] = point.y;
224  v[2] = point.z;
225  }
226  return *this;
227  }
228 
229  inline reference operator()(const std::size_t& index) { return v[index]; }
230  inline const_reference operator()(const std::size_t& index) const {
231  return v[index];
232  }
233 
234  inline reference operator[](const std::size_t& index) { return v[index]; }
235  inline const_reference operator[](const std::size_t& index) const {
236  return v[index];
237  }
238 
239  protected:
240  T v[D];
241 };
242 
243 template <typename T, std::size_t Dimension>
245  public:
247 };
248 
249 template <typename T>
250 class define_point_type<T, 2> {
251  public:
253 };
254 
255 template <typename T>
256 class define_point_type<T, 3> {
257  public:
259 };
260 
261 /************[ Segment Type ]************/
262 template <typename T, std::size_t Dimension>
263 class segment : public geometric_entity {
264  public:
265  const static std::size_t PointCount = 2;
266 
267  segment() {}
268  ~segment() {}
269 
271  typedef const PointType& const_reference;
273 
274  private:
275  PointType _data[PointCount];
276 
277  public:
278  inline reference operator[](const std::size_t& index) { return _data[index]; }
279  inline const_reference operator[](const std::size_t& index) const {
280  return _data[index];
281  }
282  inline std::size_t size() { return PointCount; }
283 };
284 
285 /************[ Line Type ]************/
286 template <typename T, std::size_t Dimension>
287 class line : public geometric_entity {
288  public:
289  const static std::size_t PointCount = 2;
290 
291  line() {}
292  ~line() {}
293 
295  typedef const PointType& const_reference;
297 
298  private:
299  PointType _data[PointCount];
300 
301  public:
302  inline reference operator[](const std::size_t& index) { return _data[index]; }
303  inline const_reference operator[](const std::size_t& index) const {
304  return _data[index];
305  }
306  inline std::size_t size() { return PointCount; }
307 };
308 
309 /************[ Triangle Type ]************/
310 template <typename T, std::size_t Dimension>
311 class triangle : public geometric_entity {
312  public:
313  const static std::size_t PointCount = 3;
314 
315  triangle() {}
317 
319  typedef const PointType& const_reference;
321 
322  private:
323  PointType _data[PointCount];
324 
325  public:
326  inline reference operator[](const std::size_t& index) { return _data[index]; }
327  inline const_reference operator[](const std::size_t& index) const {
328  return _data[index];
329  }
330  inline std::size_t size() const { return PointCount; }
331 };
332 
333 /************[ Rectangle ]************/
334 template <typename T>
335 class rectangle : public geometric_entity {
336  public:
337  const static std::size_t PointCount = 2;
338 
341 
343  typedef const PointType& const_reference;
345 
346  private:
347  PointType _data[PointCount];
348 
349  public:
350  inline reference operator[](const std::size_t& index) { return _data[index]; }
351  inline const_reference operator[](const std::size_t& index) const {
352  return _data[index];
353  }
354  inline std::size_t size() const { return PointCount; }
355 };
356 
357 /************[ Quadix Type ]************/
358 template <typename T, std::size_t Dimension>
359 class quadix : public geometric_entity {
360  public:
361  const static std::size_t PointCount = 4;
362 
363  quadix() {}
364  ~quadix() {}
365 
367  typedef const PointType& const_reference;
369 
370  private:
371  PointType _data[PointCount];
372 
373  public:
374  inline reference operator[](const std::size_t& index) { return _data[index]; }
375  inline const_reference operator[](const std::size_t& index) const {
376  return _data[index];
377  }
378  inline std::size_t size() const { return PointCount; }
379 };
380 
381 /************[ Polygon Type ]************/
382 template <typename T, std::size_t Dimension>
383 class polygon : public geometric_entity {
384  public:
385  polygon(const std::size_t initial_size = 0) : _data(initial_size) {}
386  ~polygon() {}
387 
389  typedef const PointType& const_reference;
391 
392  private:
393  std::vector<PointType> _data;
394 
395  public:
396  typedef typename std::vector<PointType>::iterator iterator;
397  typedef typename std::vector<PointType>::const_iterator const_iterator;
399 
400  public:
401  inline reference operator[](const std::size_t& index) { return _data[index]; }
402  inline const_reference operator[](const std::size_t& index) const {
403  return _data[index];
404  }
405  inline void push_back(const PointType& value) { _data.push_back(value); }
406  inline void reserve(const std::size_t amount) { _data.reserve(amount); }
407  inline void clear() const { _data.clear(); }
408  inline void clear() { _data.clear(); }
409  inline void erase(const std::size_t index) {
410  _data.erase(_data.begin() + index);
411  }
412  inline std::size_t size() const { return _data.size(); }
413  inline const_iterator begin() const { return _data.begin(); }
414  inline iterator begin() { return _data.begin(); }
415  inline const_iterator end() const { return _data.end(); }
416  inline iterator end() { return _data.end(); }
417  inline reference front() { return _data.front(); }
418  inline const_reference front() const { return _data.front(); }
419  inline reference back() { return _data.back(); }
420  inline const_reference back() const { return _data.back(); }
421  inline void reverse() { std::reverse(_data.begin(), _data.end()); }
422 };
423 
424 /************[ Circle Type ]************/
425 template <typename T>
426 class circle : public geometric_entity {
427  public:
428  T x, y, radius;
429 };
430 
431 /************[ Sphere Type ]************/
432 template <typename T>
433 class sphere : public geometric_entity {
434  public:
435  T x, y, z, radius;
436 };
437 
438 /************[ Hypersphere Type ]************/
439 template <typename T, std::size_t Dimension>
441  public:
443  typedef const PointType& const_reference;
445 
448 };
449 
450 /************[ CircularArc Type ]**************/
451 template <typename T>
453  public:
454  T x1, y1;
455  T x2, y2;
456  T cx, cy;
457  T px, py;
461 };
462 
463 /************[ Bezier Type ]************/
465 
466 /************[ Quadratic Bezier Type ]************/
467 template <typename T, std::size_t Dimension>
469  public:
470  const static std::size_t PointCount = 3;
472 
475 
477  typedef const PointType& const_reference;
479 
480  private:
481  PointType _data[PointCount];
482 
483  public:
484  inline reference operator[](const std::size_t& index) { return _data[index]; }
485  inline const_reference operator[](const std::size_t& index) const {
486  return _data[index];
487  }
488  inline std::size_t size() const { return PointCount; }
489 };
490 
491 /************[ Cubic Bezier Type ]************/
492 template <typename T, std::size_t Dimension>
494  public:
495  const static std::size_t PointCount = 4;
496  const static BezierType Type = eCubicBezier;
497 
500 
502  typedef const PointType& const_reference;
504 
505  private:
506  PointType _data[PointCount];
507 
508  public:
509  inline reference operator[](const std::size_t& index) { return _data[index]; }
510  inline const_reference operator[](const std::size_t& index) const {
511  return _data[index];
512  }
513  inline std::size_t size() const { return PointCount; }
514 };
515 
516 template <typename T, unsigned int Dimension, BezierType BType>
518 
519 template <typename T>
521  public:
523 };
524 
525 template <typename T>
527  public:
529 };
530 
531 template <typename T>
533  public:
535 };
536 
537 template <typename T>
539  public:
541 };
542 
543 /************[ Bezier Coefficients ]************/
544 template <typename T, unsigned int Dimension, BezierType Type>
547  typedef const PointType& const_reference;
549 
551 };
552 
553 /************[ Curve Point Type ]************/
554 template <typename T, std::size_t Dimension>
556  public:
559 
560  const static std::size_t PointCount = 1;
562  typedef const PointType& const_reference;
564 
565  private:
566  PointType _data[PointCount];
567 
568  public:
569  inline reference operator()() { return _data[0]; }
570  inline const_reference operator()() const { return _data[0]; }
571  inline std::size_t size() const { return PointCount; }
572 
573  T t;
574 };
575 
576 /************[ Vector Type ]************/
577 
578 template <typename T, std::size_t D>
579 class vectornd;
580 
581 template <typename T>
582 class vector2d : public point2d<T> {
583  public:
584  vector2d(const T& _x = T(0.0), const T& _y = T(0.0)) {
585  point2d<T>::x = _x;
586  point2d<T>::y = _y;
587  }
588 
589  inline vector2d<T>& operator=(const vectornd<T, 2>& vec) {
590  point2d<T>::x = vec[0];
591  point2d<T>::y = vec[1];
592  return *this;
593  }
594 };
595 
596 template <typename T>
597 class vector3d : public point3d<T> {
598  public:
599  vector3d(const T& _x = T(0.0), const T& _y = T(0.0), const T& _z = T(0.0)) {
600  point3d<T>::x = _x;
601  point3d<T>::y = _y;
602  point3d<T>::z = _z;
603  }
604 
605  inline vector3d<T>& operator=(const vectornd<T, 3>& vec) {
606  point3d<T>::x = vec[0];
607  point3d<T>::y = vec[1];
608  point3d<T>::z = vec[2];
609  return *this;
610  }
611 };
612 
613 template <typename T, std::size_t D>
614 class vectornd : public pointnd<T, D> {
615  public:
617 
618  vectornd(const T& v0) { pointnd<T, D>::v[0] = v0; }
619 
620  vectornd(const T& v0, const T& v1) {
621  pointnd<T, D>::v[0] = v0;
622  pointnd<T, D>::v[1] = v1;
623  }
624 
625  vectornd(const T& v0, const T& v1, const T& v2) {
626  pointnd<T, D>::v[0] = v0;
627  pointnd<T, D>::v[1] = v1;
628  pointnd<T, D>::v[2] = v2;
629  }
630 
631  vectornd(const T& v0, const T& v1, const T& v2, const T& v3) {
632  pointnd<T, D>::v[0] = v0;
633  pointnd<T, D>::v[1] = v1;
634  pointnd<T, D>::v[2] = v2;
635  pointnd<T, D>::v[3] = v3;
636  }
637 
638  vectornd(const vectornd<T, D>& vec) : pointnd<T, D>() {
639  for (std::size_t i = 0; i < D; ++i) (*this)[i] = vec[i];
640  }
641 
642  vectornd(const vector2d<T>& vec) {
643  (*this)[0] = vec.x;
644  (*this)[1] = vec.y;
645  }
646 
647  vectornd(const vector3d<T>& vec) {
648  (*this)[0] = vec.x;
649  (*this)[1] = vec.y;
650  (*this)[2] = vec.z;
651  }
652 };
653 
654 template <typename T, std::size_t Dimension>
656  public:
658 };
659 
660 template <typename T>
661 class define_vector_type<T, 2> {
662  public:
664 };
665 
666 template <typename T>
667 class define_vector_type<T, 3> {
668  public:
670 };
671 
672 /************[ Ray Type ]************/
673 template <typename T, std::size_t Dimension>
674 class ray : public geometric_entity {
675  public:
676  ray() {}
677  ~ray() {}
678 
681 
684 };
685 
686 /************[ Plane Type ]************/
687 template <typename T, std::size_t Dimension>
688 class plane : public geometric_entity {
689  public:
690  plane() {}
691  ~plane() {}
692 
695 
698 };
699 
700 /************[ Box Type ]************/
701 template <typename T, std::size_t Dimension>
702 class box : public geometric_entity {
703  public:
704  const static std::size_t PointCount = 2;
705 
706  box() {}
707  ~box() {}
708 
710  typedef const PointType& const_reference;
712 
713  private:
714  PointType _data[PointCount];
715 
716  public:
717  inline reference operator[](const std::size_t& index) { return _data[index]; }
718  inline const_reference operator[](const std::size_t& index) const {
719  return _data[index];
720  }
721  inline std::size_t size() const { return PointCount; }
722 };
723 
725 
732  etUnknown
733 };
734 
735 /**********[ Orientation constants ]**********/
736 const int RightHandSide = -1;
737 const int LeftHandSide = +1;
738 const int Clockwise = -1;
739 const int CounterClockwise = +1;
740 const int CollinearOrientation = 0;
741 const int AboveOrientation = +1;
742 const int BelowOrientation = -1;
743 const int CoplanarOrientation = 0;
744 const int PointInside = +1;
745 const int PointOutside = -1;
746 const int Cocircular = 0;
747 const int Cospherical = 0;
748 
749 /********[ Clipping Codes ]********/
750 const int CLIP_BOTTOM = 1;
751 const int CLIP_TOP = 2;
752 const int CLIP_LEFT = 4;
753 const int CLIP_RIGHT = 8;
754 
755 /************[ Trigonometry Tables ]************/
756 template <typename T>
757 class trig_luts {
758  public:
759  const static unsigned int TableSize = 360;
760 
762  for (std::size_t i = 0; i < 360; ++i) {
763  sin_[i] = T(std::sin((1.0 * i) * PIDiv180));
764  cos_[i] = T(std::cos((1.0 * i) * PIDiv180));
765  tan_[i] = T(std::tan((1.0 * i) * PIDiv180));
766  }
767  }
768 
769  inline const T& sin(const unsigned int angle) const { return sin_[angle]; }
770  inline const T& cos(const unsigned int angle) const { return cos_[angle]; }
771  inline const T& tan(const unsigned int angle) const { return tan_[angle]; }
772 
773  private:
774  std::vector<T> sin_;
775  std::vector<T> cos_;
776  std::vector<T> tan_;
777 };
778 
779 /************[ General Definitions ]************/
784 
789 
790 template <typename T>
792 template <>
793 inline double epsilon<double>() {
794  return static_cast<double>(Epsilon_Medium);
795 }
796 template <>
797 inline float epsilon<float>() {
798  return static_cast<float>(Epsilon_Low);
799 }
800 
801 template <typename T>
802 inline int orientation(const T& x1, const T& y1, const T& x2, const T& y2,
803  const T& px, const T& py);
804 
805 template <typename T>
806 inline int orientation(const T& x1, const T& y1, const T& z1, const T& x2,
807  const T& y2, const T& z2, const T& x3, const T& y3,
808  const T& z3, const T& px, const T& py, const T& pz);
809 
810 template <typename T>
811 inline int robust_orientation(const T& x1, const T& y1, const T& x2,
812  const T& y2, const T& px, const T& py);
813 
814 template <typename T>
815 inline int robust_orientation(const T& x1, const T& y1, const T& z1,
816  const T& x2, const T& y2, const T& z2,
817  const T& x3, const T& y3, const T& z3,
818  const T& px, const T& py, const T& pz);
819 
820 template <typename T>
821 inline int orientation(const point2d<T>& point1, const point2d<T>& point2,
822  const T& px, const T& py);
823 
824 template <typename T>
825 inline int orientation(const point2d<T>& point1, const point2d<T>& point2,
826  const point2d<T>& point3);
827 
828 template <typename T>
829 inline int orientation(const line<T, 2>& line, const point2d<T>& point);
830 
831 template <typename T>
832 inline int orientation(const segment<T, 2>& segment, const point2d<T>& point);
833 
834 template <typename T>
836 
837 template <typename T>
838 inline int orientation(const point3d<T>& point1, const point3d<T>& point2,
839  const point3d<T>& point3, const T& px, const T& py,
840  const T& pz);
841 
842 template <typename T>
843 inline int orientation(const point3d<T>& point1, const point3d<T>& point2,
844  const point3d<T>& point3, const point3d<T>& point4);
845 
846 template <typename T>
847 inline int orientation(const triangle<T, 3>& triangle, const point3d<T>& point);
848 
849 template <typename T>
850 inline bool differing_orientation(const T& x1, const T& y1, const T& x2,
851  const T& y2, const T& p1x, const T& p1y,
852  const T& p2x, const T& p2y);
853 
854 template <typename T>
855 inline bool differing_orientation(const point2d<T>& p1, const point2d<T>& p2,
856  const point2d<T>& q1, const point2d<T>& q2);
857 
858 template <typename T>
859 inline int in_circle(const T& x1, const T& y1, const T& x2, const T& y2,
860  const T& x3, const T& y3, const T& px, const T& py);
861 
862 template <typename T>
863 inline int in_circle(const point2d<T>& point1, const point2d<T>& point2,
864  const point2d<T>& point3, const point2d<T>& point4);
865 
866 template <typename T>
867 inline int in_circle(const triangle<T, 2>& triangle, const point2d<T>& point);
868 
869 template <typename T>
870 inline int in_sphere(const T& x1, const T& y1, const T& z1, const T& x2,
871  const T& y2, const T& z2, const T& x3, const T& y3,
872  const T& z3, const T& x4, const T& y4, const T& z4,
873  const T& px, const T& py, const T& pz);
874 
875 template <typename T>
876 inline int in_sphere(const point3d<T>& point1, const point3d<T>& point2,
877  const point3d<T>& point3, const point3d<T>& point4,
878  const point2d<T>& point5);
879 
880 template <typename T>
881 inline int in_sphere(const quadix<T, 3>& quadix, const point3d<T>& point);
882 
883 template <typename T>
884 inline T signed_area(const T& x1, const T& y1, const T& x2, const T& y2,
885  const T& px, const T& py);
886 
887 template <typename T>
888 inline T signed_area(const point2d<T>& point1, const point2d<T>& point2,
889  const T& px, const T& py);
890 
891 template <typename T>
892 inline T signed_area(const point2d<T>& point1, const point2d<T>& point2,
893  const point2d<T>& point3);
894 
895 template <typename T>
896 inline T signed_area(const segment<T, 2>& segment, const point2d<T>& point);
897 
898 template <typename T>
899 inline T signed_volume(const T& x1, const T& y1, const T& z1, const T& x2,
900  const T& y2, const T& z2, const T& x3, const T& y3,
901  const T& z3, const T& px, const T& py, const T& pz);
902 
903 template <typename T>
904 inline T signed_volume(const point3d<T>& point1, const point3d<T>& point2,
905  const point3d<T>& point3, const T& px, const T& py,
906  const T& pz);
907 
908 template <typename T>
909 inline T signed_volume(const point3d<T>& point1, const point3d<T>& point2,
910  const point3d<T>& point3, const point3d<T>& point4);
911 
912 template <typename T>
913 inline T signed_volume(const triangle<T, 3>& triangle, const point3d<T>& point);
914 
915 template <typename T>
916 inline bool collinear(const T& x1, const T& y1, const T& x2, const T& y2,
917  const T& x3, const T& y3, const T& epsilon = T(Epsilon));
918 
919 template <typename T>
920 inline bool collinear(const T& x1, const T& y1, const T& z1, const T& x2,
921  const T& y2, const T& z2, const T& x3, const T& y3,
922  const T& z3, const T& epsilon = T(Epsilon));
923 
924 template <typename T>
925 inline bool collinear(const point2d<T>& point1, const point2d<T>& point2,
926  const point2d<T>& point3);
927 
928 template <typename T>
929 inline bool collinear(const point3d<T>& point1, const point3d<T>& point2,
930  const point3d<T>& point3);
931 
932 template <typename T>
933 inline bool robust_collinear(const T& x1, const T& y1, const T& x2, const T& y2,
934  const T& x3, const T& y3,
935  const T& epsilon = T(Epsilon));
936 template <typename T>
937 inline bool robust_collinear(const point2d<T>& point1, const point2d<T>& point2,
938  const point2d<T>& point3,
939  const T& epsilon = T(Epsilon));
940 
941 template <typename T>
942 inline bool robust_collinear(const line<T, 2>& line, const point2d<T>& point,
943  const T& epsilon = T(Epsilon));
944 
945 template <typename T>
946 inline bool robust_collinear(const line<T, 3>& line, const point3d<T>& point,
947  const T& epsilon = T(Epsilon));
948 
949 template <typename T>
950 inline bool robust_collinear(const T& x1, const T& y1, const T& z1, const T& x2,
951  const T& y2, const T& z2, const T& x3, const T& y3,
952  const T& z3, const T& epsilon = T(Epsilon));
953 template <typename T>
954 inline bool robust_collinear(const point3d<T>& point1, const point3d<T>& point2,
955  const point3d<T>& point3,
956  const T& epsilon = T(Epsilon));
957 
958 template <typename T>
959 inline bool is_point_collinear(const T& x1, const T& y1, const T& x2,
960  const T& y2, const T& px, const T& py,
961  const bool robust = false);
962 template <typename T>
963 inline bool is_point_collinear(const point2d<T>& point1,
964  const point2d<T>& point2,
965  const point2d<T>& point3,
966  const bool robust = false);
967 
968 template <typename T>
969 inline bool is_point_collinear(const point2d<T>& point1,
970  const point2d<T>& point2, const T& px,
971  const T& py, const bool robust = false);
972 template <typename T>
974  const point2d<T>& point,
975  const bool robust = false);
976 
977 template <typename T>
978 inline bool is_point_collinear(const T& x1, const T& y1, const T& z1,
979  const T& x2, const T& y2, const T& z2,
980  const T& px, const T& py, const T& pz,
981  const bool robust = false);
982 
983 template <typename T>
984 inline bool is_point_collinear(const point3d<T>& point1,
985  const point3d<T>& point2,
986  const point3d<T>& point3,
987  const bool robust = false);
988 
989 template <typename T>
991  const point3d<T>& point,
992  const bool robust = false);
993 
994 template <typename T>
995 inline bool robust_coplanar(const point3d<T> point1, const point3d<T> point2,
996  const point3d<T> point3, const point3d<T> point4,
997  const T& epsilon = T(Epsilon));
998 
999 template <typename T>
1000 inline bool coplanar(const ray<T, 3>& ray1, const ray<T, 3>& ray2);
1001 template <typename T>
1002 inline bool coplanar(const segment<T, 3>& segment1,
1003  const segment<T, 3>& segment2);
1004 template <typename T>
1005 inline bool coplanar(const line<T, 3>& line1, const line<T, 3>& line2);
1006 template <typename T>
1007 inline bool coplanar(const triangle<T, 3>& triangle1,
1008  const triangle<T, 3>& triangle2);
1009 template <typename T>
1010 inline bool coplanar(const quadix<T, 3>& quadix1, const quadix<T, 3>& quadix2);
1011 
1012 template <typename T>
1013 inline bool cocircular(const T& x1, const T& y1, const T& x2, const T& y2,
1014  const T& x3, const T& y3, const T& x4, const T& y4,
1015  const T& epsilon = T(Epsilon));
1016 
1017 template <typename T>
1018 inline bool cocircular(const point2d<T>& point1, const point2d<T>& point2,
1019  const point2d<T>& point3, const point2d<T>& point4,
1020  const T& epsilon = T(Epsilon));
1021 
1022 template <typename T>
1023 inline bool cocircular(const triangle<T, 2>& triangle, const point2d<T>& point,
1024  const T& epsilon = T(Epsilon));
1025 
1026 template <typename T>
1027 inline bool cocircular(const circle<T>& circle, const point2d<T>& point,
1028  const T& epsilon = T(Epsilon));
1029 
1030 template <typename T>
1031 inline bool is_skinny_triangle(const T& x1, const T& y1, const T& x2,
1032  const T& y2, const T& x3, const T& y3);
1033 
1034 template <typename T>
1035 inline bool is_skinny_triangle(const point2d<T>& point1,
1036  const point2d<T>& point2,
1037  const point2d<T>& point3);
1038 
1039 template <typename T>
1041 
1042 template <typename T>
1043 inline bool intersect(const T& x1, const T& y1, const T& x2, const T& y2,
1044  const T& x3, const T& y3, const T& x4, const T& y4);
1045 
1046 template <typename T>
1047 inline bool intersect(const T& x1, const T& y1, const T& x2, const T& y2,
1048  const T& x3, const T& y3, const T& x4, const T& y4, T& ix,
1049  T& iy);
1050 template <typename T>
1051 inline bool intersect(const point2d<T>& point1, const point2d<T>& point2,
1052  const point2d<T>& point3, const point2d<T>& point4);
1053 
1054 template <typename T>
1055 inline bool intersect(const point2d<T>& point1, const point2d<T>& point2,
1056  const point2d<T>& point3, const point2d<T>& point4,
1057  point2d<T>& int_point);
1058 
1059 template <typename T>
1060 inline bool intersect(const segment<T, 2>& segment1,
1061  const segment<T, 2>& segment2);
1062 
1063 template <typename T>
1064 inline bool intersect(const segment<T, 2>& segment1,
1065  const segment<T, 2>& segment2, T& ix, T& iy);
1066 
1067 template <typename T>
1068 inline bool intersect(const segment<T, 2>& segment1,
1069  const segment<T, 2>& segment2, point2d<T>& i_point);
1070 
1071 template <typename T>
1072 inline bool intersect(const T& x1, const T& y1, const T& z1, const T& x2,
1073  const T& y2, const T& z2, const T& x3, const T& y3,
1074  const T& z3, const T& x4, const T& y4, const T& z4,
1075  const T& fuzzy = T(0.0));
1076 
1077 template <typename T>
1078 inline bool intersect(const point3d<T>& point1, const point3d<T>& point2,
1079  const point3d<T>& point3, const point3d<T>& point4,
1080  const T& fuzzy = T(0.0));
1081 
1082 template <typename T>
1083 inline bool intersect(const segment<T, 3>& segment1,
1084  const segment<T, 3>& segment2, const T& fuzzy = T(0.0));
1085 template <typename T>
1086 inline bool intersect(const segment<T, 2>& segment,
1087  const rectangle<T>& rectangle);
1088 template <typename T>
1089 inline bool intersect(const segment<T, 2>& segment,
1090  const triangle<T, 2>& triangle);
1091 template <typename T>
1092 inline bool intersect(const segment<T, 2>& segment, const quadix<T, 2>& quadix);
1093 template <typename T>
1094 inline bool intersect(const segment<T, 2>& segment, const line<T, 2>& line);
1095 template <typename T>
1096 inline bool intersect(const segment<T, 2>& segment, const circle<T>& circle);
1097 template <typename T>
1098 inline bool intersect(const segment<T, 2>& segment,
1099  const quadratic_bezier<T, 2>& bezier,
1100  const std::size_t& steps = 1000);
1101 template <typename T>
1102 inline bool intersect(const segment<T, 2>& segment,
1103  const cubic_bezier<T, 2>& bezier,
1104  const std::size_t& steps = 1000);
1105 template <typename T>
1106 inline bool intersect(const segment<T, 3>& segment, const line<T, 3>& line,
1107  const T& fuzzy = T(0.0));
1108 template <typename T>
1109 inline bool intersect(const segment<T, 3>& segment, const box<T, 3>& box);
1110 template <typename T>
1111 inline bool intersect(const segment<T, 3>& segment, const sphere<T>& sphere);
1112 template <typename T>
1113 inline bool intersect(const segment<T, 3>& segment, const plane<T, 3>& plane);
1114 template <typename T>
1115 inline bool intersect(const segment<T, 3>& segment,
1116  const quadratic_bezier<T, 3>& bezier,
1117  const std::size_t& steps = 1000);
1118 template <typename T>
1119 inline bool intersect(const segment<T, 3>& segment,
1120  const cubic_bezier<T, 3>& bezier,
1121  const std::size_t& steps = 1000);
1122 template <typename T>
1123 inline bool intersect(const line<T, 2>& line, const triangle<T, 2>& triangle);
1124 template <typename T>
1125 inline bool intersect(const line<T, 2>& line, const quadix<T, 2>& quadix);
1126 template <typename T>
1127 inline bool intersect(const line<T, 2>& line1, const line<T, 2>& line2);
1128 template <typename T>
1129 inline bool intersect(const line<T, 2>& line, const circle<T>& circle);
1130 template <typename T>
1131 inline bool intersect(const line<T, 2>& line,
1132  const quadratic_bezier<T, 2>& bezier,
1133  const std::size_t& steps = 1000);
1134 template <typename T>
1135 inline bool intersect(const line<T, 2>& line, const cubic_bezier<T, 2>& bezier,
1136  const std::size_t& steps = 1000);
1137 template <typename T>
1138 inline bool intersect(const line<T, 3>& line, const triangle<T, 3>& triangle);
1139 template <typename T>
1140 inline bool intersect(const line<T, 3>& line, const plane<T, 3>& plane);
1141 template <typename T>
1142 inline bool intersect(const line<T, 3>& line, const sphere<T>& sphere);
1143 template <typename T>
1144 inline bool intersect(const line<T, 3>& line,
1145  const quadratic_bezier<T, 3>& bezier,
1146  const std::size_t& steps = 1000);
1147 template <typename T>
1148 inline bool intersect(const line<T, 3>& line, const cubic_bezier<T, 3>& bezier,
1149  const std::size_t& steps = 1000);
1150 template <typename T>
1151 inline bool intersect(const triangle<T, 2>& triangle, const circle<T>& circle);
1152 template <typename T>
1153 inline bool intersect(const triangle<T, 2>& triangle,
1154  const rectangle<T>& rectangle);
1155 template <typename T>
1156 inline bool intersect(const triangle<T, 2>& triangle,
1157  const quadratic_bezier<T, 2>& bezier,
1158  const std::size_t& steps = 1000);
1159 template <typename T>
1160 inline bool intersect(const triangle<T, 2>& triangle,
1161  const cubic_bezier<T, 2>& bezier,
1162  const std::size_t& steps = 1000);
1163 template <typename T>
1164 inline bool intersect(const rectangle<T>& rectangle1,
1165  const rectangle<T>& rectangle2);
1166 template <typename T>
1167 inline bool intersect(const triangle<T, 2>& triangle1,
1168  const triangle<T, 2>& triangle2);
1169 template <typename T>
1170 inline bool intersect(const rectangle<T>& rectangle, const circle<T>& circle);
1171 template <typename T>
1172 inline bool intersect(const rectangle<T>& rectangle,
1173  const quadratic_bezier<T, 2>& bezier,
1174  const std::size_t& steps = 1000);
1175 template <typename T>
1176 inline bool intersect(const rectangle<T>& rectangle,
1177  const cubic_bezier<T, 2>& bezier,
1178  const std::size_t& steps = 1000);
1179 template <typename T>
1180 inline bool intersect(const quadix<T, 2>& quadix,
1181  const quadratic_bezier<T, 2>& bezier,
1182  const std::size_t& steps = 1000);
1183 template <typename T>
1184 inline bool intersect(const quadix<T, 2>& quadix,
1185  const cubic_bezier<T, 2>& bezier,
1186  const std::size_t& steps = 1000);
1187 template <typename T>
1188 inline bool intersect(const circle<T>& circle1, const circle<T>& circle2);
1189 template <typename T>
1190 inline bool intersect(const circle<T>& circle,
1191  const quadratic_bezier<T, 2>& bezier,
1192  const std::size_t& steps = 1000);
1193 template <typename T>
1194 inline bool intersect(const circle<T>& circle, const cubic_bezier<T, 2>& bezier,
1195  const std::size_t& steps = 1000);
1196 template <typename T>
1197 inline bool intersect(const box<T, 3>& box, const sphere<T>& sphere);
1198 template <typename T>
1199 inline bool intersect(const sphere<T>& sphere1, const sphere<T>& sphere2);
1200 template <typename T>
1201 inline bool intersect(const sphere<T>& sphere,
1202  const quadratic_bezier<T, 3>& bezier,
1203  const std::size_t& steps = 1000);
1204 template <typename T>
1205 inline bool intersect(const sphere<T>& sphere, const cubic_bezier<T, 3>& bezier,
1206  const std::size_t& steps = 1000);
1207 template <typename T>
1208 inline bool intersect(const ray<T, 2>& ray1, const ray<T, 2>& ray2);
1209 template <typename T>
1210 inline bool intersect(const ray<T, 3>& ray1, const ray<T, 3>& ray2);
1211 template <typename T>
1212 inline bool intersect(const ray<T, 2>& ray, const segment<T, 2>& segment);
1213 template <typename T>
1214 inline bool intersect(const ray<T, 3>& ray, const segment<T, 3>& segment);
1215 template <typename T>
1216 inline bool intersect(const ray<T, 2>& ray, const rectangle<T>& rectangle);
1217 template <typename T>
1218 inline bool intersect(const ray<T, 3>& ray, const box<T, 3>& box);
1219 template <typename T>
1220 inline bool intersect(const ray<T, 2>& ray, const triangle<T, 2>& triangle);
1221 template <typename T>
1222 inline bool intersect(const ray<T, 3>& ray, const triangle<T, 3>& triangle);
1223 template <typename T>
1224 inline bool intersect(const ray<T, 2>& ray, const quadix<T, 2>& quadix);
1225 template <typename T>
1226 inline bool intersect(const ray<T, 2>& ray, const circle<T>& circle);
1227 template <typename T>
1228 inline bool intersect(const ray<T, 3>& ray, const sphere<T>& sphere);
1229 template <typename T>
1230 inline bool intersect(const ray<T, 3>& ray, const plane<T, 3>& plane);
1231 template <typename T>
1232 inline bool intersect(const ray<T, 2>& ray, const polygon<T, 2>& polygon);
1233 template <typename T>
1234 inline bool intersect(const plane<T, 3>& plane1, const plane<T, 3>& plane2);
1235 template <typename T>
1236 inline bool intersect(const plane<T, 3>& plane, const sphere<T>& sphere);
1237 template <typename T>
1238 inline bool intersect(const plane<T, 3>& plane, const line<T, 3>& line);
1239 
1240 template <typename T>
1241 inline bool simple_intersect(const T& x1, const T& y1, const T& x2, const T& y2,
1242  const T& x3, const T& y3, const T& x4,
1243  const T& y4);
1244 
1245 template <typename T>
1246 inline bool simple_intersect(const point2d<T>& point1, const point2d<T>& point2,
1247  const point2d<T>& point3,
1248  const point2d<T>& point4);
1249 
1250 template <typename T>
1251 inline bool simple_intersect(const segment<T, 2>& segment1,
1252  const segment<T, 2>& segment2);
1253 
1254 template <typename T>
1255 inline bool intersect_vertical_horizontal(const segment<T, 2>& segment1,
1256  const segment<T, 2>& segment2);
1257 template <typename T>
1258 inline bool intersect_vertical_vertical(const segment<T, 2>& segment1,
1259  const segment<T, 2>& segment2);
1260 template <typename T>
1262  const segment<T, 2>& segment2);
1263 
1264 template <typename T>
1265 inline void intersection_point(const T& x1, const T& y1, const T& x2,
1266  const T& y2, const T& x3, const T& y3,
1267  const T& x4, const T& y4, T& ix, T& iy);
1268 
1269 template <typename T>
1270 inline void intersection_point(const point2d<T>& point1,
1271  const point2d<T>& point2,
1272  const point2d<T>& point3,
1273  const point2d<T>& point4, T& ix, T& iy);
1274 
1275 template <typename T>
1277  const point2d<T>& point2,
1278  const point2d<T>& point3,
1279  const point2d<T>& point4);
1280 template <typename T>
1282  const segment<T, 2>& segment2);
1283 
1284 template <typename T>
1285 inline void intersection_point(const T& x1, const T& y1, const T& z1,
1286  const T& x2, const T& y2, const T& z2,
1287  const T& x3, const T& y3, const T& z3,
1288  const T& x4, const T& y4, const T& z4, T& ix,
1289  T& iy, T& iz, const T& fuzzy = T(0.0));
1290 
1291 template <typename T>
1292 inline void intersection_point(const point3d<T>& point1,
1293  const point3d<T>& point2,
1294  const point3d<T>& point3,
1295  const point3d<T>& point4, T& ix, T& iy, T& iz,
1296  const T& fuzzy = T(0.0));
1297 
1298 template <typename T>
1300  const point3d<T>& point2,
1301  const point3d<T>& point3,
1302  const point3d<T>& point4,
1303  const T& fuzzy = T(0.0));
1304 
1305 template <typename T>
1307  const segment<T, 3>& segment2,
1308  const T& fuzzy = T(0.0));
1309 
1310 template <typename T>
1312  const line<T, 2>& line);
1313 
1314 template <typename T>
1316  const line<T, 3>& line,
1317  const T& fuzzy = T(0.0));
1318 
1319 template <typename T>
1321  const plane<T, 3>& plane);
1322 
1323 template <typename T, typename OutputIterator>
1325  const quadratic_bezier<T, 2>& bezier,
1326  OutputIterator out,
1327  const std::size_t& steps = 1000);
1328 
1329 template <typename T, typename OutputIterator>
1331  const cubic_bezier<T, 2>& bezier,
1332  OutputIterator out,
1333  const std::size_t& steps = 1000);
1334 
1335 template <typename T, typename OutputIterator>
1337  const quadratic_bezier<T, 3>& bezier,
1338  OutputIterator out,
1339  const std::size_t& steps = 1000);
1340 
1341 template <typename T, typename OutputIterator>
1343  const cubic_bezier<T, 3>& bezier,
1344  OutputIterator out,
1345  const std::size_t& steps = 1000);
1346 
1347 template <typename T>
1349  const line<T, 2>& line2);
1350 
1351 template <typename T>
1353  const line<T, 3>& line2,
1354  const T& fuzzy = T(0.0));
1355 
1356 template <typename T>
1357 inline void intersection_point(const circle<T>& circle1,
1358  const circle<T>& circle2, point2d<T>& point1,
1359  point2d<T>& point2);
1360 
1361 template <typename T, typename OutputIterator>
1363  const triangle<T, 2>& triangle,
1364  OutputIterator out);
1365 
1366 template <typename T>
1368  const triangle<T, 3>& triangle,
1369  point3d<T>& ipoint);
1370 
1371 template <typename T>
1373  const plane<T, 3>& plane);
1374 
1375 template <typename T, typename OutputIterator>
1376 inline void intersection_point(const T& x1, const T& y1, const T& x2,
1377  const T& y2, const T& cx, const T& cy,
1378  const T& radius, OutputIterator out);
1379 
1380 template <typename T, typename OutputIterator>
1382  const circle<T>& circle, OutputIterator out);
1383 
1384 template <typename T, typename OutputIterator>
1386  OutputIterator out);
1387 
1388 template <typename T, typename OutputIterator>
1390  const sphere<T>& sphere, OutputIterator out);
1391 
1392 template <typename T, typename OutputIterator>
1394  OutputIterator out);
1395 
1396 template <typename T>
1398  const ray<T, 2>& ray2);
1399 
1400 template <typename T>
1402  const triangle<T, 3>& triangle);
1403 
1404 template <typename T>
1406  const plane<T, 3>& plane);
1407 
1408 template <typename T, typename OutputIterator>
1409 inline void intersection_point(const ray<T, 2>& ray, const circle<T>& circle,
1410  OutputIterator out);
1411 
1412 template <typename T, typename OutputIterator>
1413 inline void intersection_point(const ray<T, 3>& ray, const sphere<T>& sphere,
1414  OutputIterator out);
1415 
1416 template <typename T>
1418  const T& x1, const T& y1, const T& z1, const T& x2, const T& y2,
1419  const T& z2, const T& x3, const T& y3, const T& z3, const T& x4,
1420  const T& y4, const T& z4, T& Ix, T& Iy, T& Iz, const T& fuzzy = T(0.0));
1421 
1422 template <typename T>
1423 inline T normalize_angle(const T& angle);
1424 
1425 template <typename T>
1426 inline T vertical_mirror(const T& angle);
1427 
1428 template <typename T>
1429 inline T horizontal_mirror(const T& angle);
1430 
1431 template <typename T>
1432 inline unsigned int quadrant(const T& angle);
1433 
1434 template <typename T>
1435 inline unsigned int quadrant(const T& x, const T& y);
1436 
1437 template <typename T>
1438 inline unsigned int quadrant(const point2d<T>& point);
1439 
1440 template <typename T>
1441 inline T vertex_angle(const T& x1, const T& y1, const T& x2, const T& y2,
1442  const T& x3, const T& y3);
1443 
1444 template <typename T>
1445 inline T vertex_angle(const point2d<T>& point1, const point2d<T>& point2,
1446  const point2d<T>& point3);
1447 
1448 template <typename T>
1449 inline T vertex_angle(const T& x1, const T& y1, const T& z1, const T& x2,
1450  const T& y2, const T& z2, const T& x3, const T& y3,
1451  const T& z3);
1452 
1453 template <typename T>
1454 inline T vertex_angle(const point3d<T>& point1, const point3d<T>& point2,
1455  const point3d<T>& point3);
1456 
1457 template <typename T>
1458 inline T oriented_vertex_angle(const T& x1, const T& y1, const T& x2,
1459  const T& y2, const T& x3, const T& y3,
1460  const int orient = Clockwise);
1461 template <typename T>
1462 inline T oriented_vertex_angle(const point2d<T>& point1,
1463  const point2d<T>& point2,
1464  const point2d<T>& point3,
1465  const int orient = Clockwise);
1466 template <typename T>
1467 inline T cartesian_angle(const T& x, const T& y);
1468 
1469 template <typename T>
1470 inline T cartesian_angle(const point2d<T>& point);
1471 
1472 template <typename T>
1473 inline T robust_cartesian_angle(const T& x, const T& y);
1474 
1475 template <typename T>
1476 inline T robust_cartesian_angle(const point2d<T>& point);
1477 
1478 template <typename T>
1479 inline T cartesian_angle(const T& x, const T& y, const T& ox, const T& oy);
1480 
1481 template <typename T>
1482 inline T cartesian_angle(const point2d<T>& point, const point2d<T>& origin);
1483 
1484 template <typename T>
1485 inline T robust_cartesian_angle(const T& x, const T& y, const T& ox,
1486  const T& oy);
1487 
1488 template <typename T>
1489 inline T robust_cartesian_angle(const point2d<T>& point,
1490  const point2d<T>& origin);
1491 
1492 template <typename T>
1493 inline bool parallel(const T& x1, const T& y1, const T& x2, const T& y2,
1494  const T& x3, const T& y3, const T& x4, const T& y4,
1495  const T& epsilon = T(Epsilon));
1496 
1497 template <typename T>
1498 inline bool parallel(const point2d<T>& point1, const point2d<T>& point2,
1499  const point2d<T>& point3, const point2d<T>& point4,
1500  const T& epsilon = T(Epsilon));
1501 
1502 template <typename T>
1503 inline bool parallel(const segment<T, 2>& segment1,
1504  const segment<T, 2>& segment2,
1505  const T& epsilon = T(Epsilon));
1506 
1507 template <typename T>
1508 inline bool parallel(const line<T, 2>& line1, const line<T, 2>& line2,
1509  const T& epsilon = T(Epsilon));
1510 
1511 template <typename T>
1512 inline bool parallel(const T& x1, const T& y1, const T& z1, const T& x2,
1513  const T& y2, const T& z2, const T& x3, const T& y3,
1514  const T& z3, const T& x4, const T& y4, const T& z4,
1515  const T& epsilon = T(Epsilon));
1516 
1517 template <typename T>
1518 inline bool parallel(const point3d<T>& point1, const point3d<T>& point2,
1519  const point3d<T>& point3, const point3d<T>& point4,
1520  const T& epsilon = T(Epsilon));
1521 
1522 template <typename T>
1523 inline bool parallel(const segment<T, 3>& segment1,
1524  const segment<T, 3>& segment2,
1525  const T& epsilon = T(Epsilon));
1526 
1527 template <typename T>
1528 inline bool parallel(const line<T, 3>& line1, const line<T, 3>& line2,
1529  const T& epsilon = T(Epsilon));
1530 
1531 template <typename T>
1532 inline bool robust_parallel(const T& x1, const T& y1, const T& x2, const T& y2,
1533  const T& x3, const T& y3, const T& x4, const T& y4,
1534  const T& epsilon = T(Epsilon));
1535 
1536 template <typename T>
1537 inline bool robust_parallel(const point2d<T>& point1, const point2d<T>& point2,
1538  const point2d<T>& point3, const point2d<T>& point4,
1539  const T& epsilon = T(Epsilon));
1540 
1541 template <typename T>
1542 inline bool robust_parallel(const segment<T, 2>& segment1,
1543  const segment<T, 2>& segment2,
1544  const T& epsilon = T(Epsilon));
1545 
1546 template <typename T>
1547 inline bool robust_parallel(const line<T, 2>& line1, const line<T, 2>& line2,
1548  const T& epsilon = T(Epsilon));
1549 
1550 template <typename T>
1551 inline bool robust_parallel(const line<T, 2>& line,
1552  const segment<T, 2>& segment,
1553  const T& epsilon = T(Epsilon));
1554 
1555 template <typename T>
1556 inline bool robust_parallel(const T& x1, const T& y1, const T& z1, const T& x2,
1557  const T& y2, const T& z2, const T& x3, const T& y3,
1558  const T& z3, const T& x4, const T& y4, const T& z4,
1559  const T& epsilon = T(Epsilon));
1560 
1561 template <typename T>
1562 inline bool robust_parallel(const point3d<T>& point1, const point3d<T>& point2,
1563  const point3d<T>& point3, const point3d<T>& point4,
1564  const T& epsilon = T(Epsilon));
1565 
1566 template <typename T>
1567 inline bool robust_parallel(const segment<T, 3>& segment1,
1568  const segment<T, 3>& segment2,
1569  const T& epsilon = T(Epsilon));
1570 
1571 template <typename T>
1572 inline bool robust_parallel(const line<T, 3>& line1, const line<T, 3>& line2,
1573  const T& epsilon = T(Epsilon));
1574 
1575 template <typename T>
1576 inline bool robust_parallel(const line<T, 3>& line,
1577  const segment<T, 3>& segment,
1578  const T& epsilon = T(Epsilon));
1579 
1580 template <typename T>
1581 inline bool perpendicular(const T& x1, const T& y1, const T& x2, const T& y2,
1582  const T& x3, const T& y3, const T& x4, const T& y4,
1583  const T& epsilon = T(Epsilon));
1584 
1585 template <typename T>
1586 inline bool perpendicular(const point2d<T>& point1, const point2d<T>& point2,
1587  const point2d<T>& point3, const point2d<T>& point4,
1588  const T& epsilon = T(Epsilon));
1589 
1590 template <typename T>
1591 inline bool perpendicular(const segment<T, 2>& segment1,
1592  const segment<T, 2>& segment2,
1593  const T& epsilon = T(Epsilon));
1594 
1595 template <typename T>
1596 inline bool perpendicular(const line<T, 2>& line1, const line<T, 2>& line2,
1597  const T& epsilon = T(Epsilon));
1598 
1599 template <typename T>
1601  const T& epsilon = T(Epsilon));
1602 
1603 template <typename T>
1604 inline bool perpendicular(const T& x1, const T& y1, const T& z1, const T& x2,
1605  const T& y2, const T& z2, const T& x3, const T& y3,
1606  const T& z3, const T& x4, const T& y4, const T& z4,
1607  const T& epsilon = T(Epsilon));
1608 
1609 template <typename T>
1610 inline bool perpendicular(const point3d<T>& point1, const point3d<T>& point2,
1611  const point3d<T>& point3, const point3d<T>& point4,
1612  const T& epsilon = T(Epsilon));
1613 
1614 template <typename T>
1615 inline bool perpendicular(const segment<T, 3>& segment1,
1616  const segment<T, 3>& segment2,
1617  const T& epsilon = T(Epsilon));
1618 
1619 template <typename T>
1620 inline bool perpendicular(const line<T, 3>& line1, const line<T, 3>& line2,
1621  const T& epsilon = T(Epsilon));
1622 
1623 template <typename T>
1624 inline bool robust_perpendicular(const T& x1, const T& y1, const T& x2,
1625  const T& y2, const T& x3, const T& y3,
1626  const T& x4, const T& y4,
1627  const T& epsilon = T(Epsilon));
1628 
1629 template <typename T>
1630 inline bool robust_perpendicular(const point2d<T>& point1,
1631  const point2d<T>& point2,
1632  const point2d<T>& point3,
1633  const point2d<T>& point4,
1634  const T& epsilon = T(Epsilon));
1635 
1636 template <typename T>
1637 inline bool robust_perpendicular(const segment<T, 2>& segment1,
1638  const segment<T, 2>& segment2,
1639  const T& epsilon = T(Epsilon));
1640 
1641 template <typename T>
1642 inline bool robust_perpendicular(const line<T, 2>& line1,
1643  const line<T, 2>& line2,
1644  const T& epsilon = T(Epsilon));
1645 
1646 template <typename T>
1647 inline bool robust_perpendicular(const T& x1, const T& y1, const T& z1,
1648  const T& x2, const T& y2, const T& z2,
1649  const T& x3, const T& y3, const T& z3,
1650  const T& x4, const T& y4, const T& z4,
1651  const T& epsilon = T(Epsilon));
1652 
1653 template <typename T>
1654 inline bool robust_perpendicular(const point3d<T>& point1,
1655  const point3d<T>& point2,
1656  const point3d<T>& point3,
1657  const point3d<T>& point4,
1658  const T& epsilon = T(Epsilon));
1659 
1660 template <typename T>
1661 inline bool robust_perpendicular(const segment<T, 3>& segment1,
1662  const segment<T, 3>& segment2,
1663  const T& epsilon = T(Epsilon));
1664 
1665 template <typename T>
1666 inline bool robust_perpendicular(const line<T, 3>& line1,
1667  const line<T, 3>& line2,
1668  const T& epsilon = T(Epsilon));
1669 
1670 template <typename T>
1672  const segment<T, 2>& segment,
1673  const T& epsilon = T(Epsilon));
1674 
1675 template <typename T>
1676 inline bool line_to_line_intersect(const T& x1, const T& y1, const T& x2,
1677  const T& y2, const T& x3, const T& y3,
1678  const T& x4, const T& y4);
1679 template <typename T>
1680 inline bool line_to_line_intersect(const line<T, 2>& line1,
1681  const line<T, 2>& line2);
1682 
1683 template <typename T>
1684 inline bool rectangle_to_rectangle_intersect(const T& x1, const T& y1,
1685  const T& x2, const T& y2,
1686  const T& x3, const T& y3,
1687  const T& x4, const T& y4);
1688 
1689 template <typename T>
1690 inline bool rectangle_to_rectangle_intersect(const rectangle<T>& rectangle1,
1691  const rectangle<T>& rectangle2);
1692 
1693 template <typename T>
1694 inline bool box_to_box_intersect(const T& x1, const T& y1, const T& z1,
1695  const T& x2, const T& y2, const T& z2,
1696  const T& x3, const T& y3, const T& z3,
1697  const T& x4, const T& y4, const T& z4);
1698 
1699 template <typename T>
1700 inline bool box_to_box_intersect(const box<T, 3>& box1, const box<T, 3>& box2);
1701 
1702 template <typename T, unsigned int Dimension, typename Simplex, typename Bezier>
1703 inline bool simplex_to_bezier_intersect(const Simplex& simplex,
1704  const Bezier& bezier,
1705  const std::size_t& steps);
1706 
1707 template <typename T, unsigned int Dimension, typename Bezier,
1708  typename Iterator>
1709 inline bool simplex_to_bezier_intersect(const Iterator& begin,
1710  const Iterator& end,
1711  const Bezier& bezier,
1712  const std::size_t& steps);
1713 
1714 template <typename T>
1715 inline bool rectangle_within_rectangle(const T& x1, const T& y1, const T& x2,
1716  const T& y2, const T& x3, const T& y3,
1717  const T& x4, const T& y4);
1718 
1719 template <typename T>
1720 inline bool rectangle_within_rectangle(const rectangle<T>& rectangle1,
1721  const rectangle<T>& rectangle2);
1722 
1723 template <typename T>
1724 inline bool box_within_box(const T& x1, const T& y1, const T& z1, const T& x2,
1725  const T& y2, const T& z2, const T& x3, const T& y3,
1726  const T& z3, const T& x4, const T& y4, const T& z4);
1727 
1728 template <typename T>
1729 inline bool box_within_box(const box<T, 3>& box1, const box<T, 3>& box2);
1730 
1731 template <typename T>
1732 inline bool circle_within_rectangle(const T& x, const T& y, const T& radius,
1733  const T& x1, const T& y1, const T& x2,
1734  const T& y2);
1735 
1736 template <typename T>
1738  const rectangle<T>& rectangle);
1739 
1740 template <typename T>
1741 inline bool triangle_within_rectangle(const T& x1, const T& y1, const T& x2,
1742  const T& y2, const T& x3, const T& y3,
1743  const T& x4, const T& y4, const T& x5,
1744  const T& y5);
1745 template <typename T>
1747  const rectangle<T>& rectangle);
1748 
1749 template <typename T>
1750 inline bool segment_within_rectangle(const T& x1, const T& y1, const T& x2,
1751  const T& y2, const T& x3, const T& y3,
1752  const T& x4, const T& y4);
1753 
1754 template <typename T>
1756  const rectangle<T>& rectangle);
1757 
1758 template <typename T>
1759 inline bool quadix_within_rectangle(const T& x1, const T& y1, const T& x2,
1760  const T& y2, const T& x3, const T& y3,
1761  const T& x4, const T& y4, const T& x5,
1762  const T& y5, const T& x6, const T& y6);
1763 
1764 template <typename T>
1766  const rectangle<T>& rectangle);
1767 
1768 template <typename T>
1770  const rectangle<T>& rectangle);
1771 
1772 template <typename T>
1773 inline bool sphere_within_box(const T& x, const T& y, const T& z,
1774  const T& radius, const T& x1, const T& y1,
1775  const T& z1, const T& x2, const T& y2,
1776  const T& z2);
1777 
1778 template <typename T>
1779 inline bool sphere_within_box(const sphere<T>& sphere, const box<T, 3>& box);
1780 
1781 template <typename T>
1782 inline bool triangle_within_box(const T& x1, const T& y1, const T& z1,
1783  const T& x2, const T& y2, const T& z2,
1784  const T& x3, const T& y3, const T& z3,
1785  const T& x4, const T& y4, const T& z4,
1786  const T& x5, const T& y5, const T& z5);
1787 template <typename T>
1789  const box<T, 3>& box);
1790 
1791 template <typename T>
1792 inline bool segment_within_box(const T& x1, const T& y1, const T& z1,
1793  const T& x2, const T& y2, const T& z2,
1794  const T& x3, const T& y3, const T& z3,
1795  const T& x4, const T& y4, const T& z4);
1796 
1797 template <typename T>
1799  const box<T, 3>& box);
1800 
1801 template <typename T>
1802 inline bool quadix_within_box(const T& x1, const T& y1, const T& z1,
1803  const T& x2, const T& y2, const T& z2,
1804  const T& x3, const T& y3, const T& z3,
1805  const T& x4, const T& y4, const T& z4,
1806  const T& x5, const T& y5, const T& z5,
1807  const T& x6, const T& y6, const T& z6);
1808 
1809 template <typename T>
1810 inline bool quadix_within_box(const quadix<T, 3>& quadix, const box<T, 3>& box);
1811 
1812 template <typename T>
1814  const box<T, 3>& box);
1815 
1816 template <typename T>
1817 inline bool circle_in_circle(const circle<T>& circle1,
1818  const circle<T>& circle2);
1819 
1820 template <typename T>
1821 inline bool is_tangent(const segment<T, 2>& segment, const circle<T>& circle);
1822 
1823 template <typename T>
1824 inline bool point_of_reflection(const T& sx1, const T& sy1, const T& sx2,
1825  const T& sy2, const T& p1x, const T& p1y,
1826  const T& p2x, const T& p2y, T& rpx, T& rpy);
1827 template <typename T>
1829  const point2d<T>& point1,
1830  const point2d<T>& point2,
1831  point2d<T>& reflection_point);
1832 
1833 template <typename T>
1835  const std::size_t& edge_index);
1836 template <typename T>
1838  const std::size_t& edge_index);
1839 template <typename T>
1841  const std::size_t& edge_index);
1842 template <typename T>
1844  const std::size_t& edge_index);
1845 template <typename T>
1847  const std::size_t& edge);
1848 template <typename T>
1850  const std::size_t& edge);
1851 template <typename T>
1853  const std::size_t& edge);
1854 
1855 template <typename T>
1857  const std::size_t& corner);
1858 template <typename T>
1860  const std::size_t& corner);
1861 
1862 template <typename T>
1864 template <typename T>
1866 
1867 template <typename T>
1869  const std::size_t& corner_index);
1870 template <typename T>
1872  const std::size_t& corner_index);
1873 
1874 template <typename T>
1876  const std::size_t& bisector);
1877 template <typename T>
1879  const std::size_t& bisector);
1880 
1881 template <typename T>
1883  const triangle<T, 2>& triangle, const std::size_t& corner,
1884  const std::size_t& opposing_corner);
1885 
1886 template <typename T>
1888  const triangle<T, 3>& triangle, const std::size_t& corner,
1889  const std::size_t& opposing_corner);
1890 
1891 template <typename T>
1893  const std::size_t& median);
1894 template <typename T>
1896  const std::size_t& median);
1897 
1898 template <typename T>
1900  const std::size_t& symmedian);
1901 template <typename T>
1903  const std::size_t& symmedian);
1904 
1905 template <typename T>
1907 template <typename T>
1909 
1910 template <typename T>
1912  const std::size_t& corner);
1913 template <typename T>
1915  const std::size_t& corner);
1916 
1917 template <typename T>
1919 
1920 template <typename T>
1922  const point2d<T>& point,
1923  const std::size_t& median);
1924 
1925 template <typename T>
1927  const point3d<T>& point,
1928  const std::size_t& median);
1929 
1930 template <typename T>
1932  const point2d<T>& point);
1933 template <typename T>
1935  const point3d<T>& point);
1936 
1937 template <typename T>
1939  const point2d<T>& point);
1940 template <typename T>
1942  const point3d<T>& point);
1943 
1944 template <typename T>
1945 inline bool point_in_rectangle(const T& px, const T& py, const T& x1,
1946  const T& y1, const T& x2, const T& y2);
1947 
1948 template <typename T>
1949 inline bool point_in_rectangle(const point2d<T>& point, const T& x1,
1950  const T& y1, const T& x2, const T& y2);
1951 
1952 template <typename T>
1953 inline bool point_in_rectangle(const T& px, const T& py,
1954  const rectangle<T>& rectangle);
1955 
1956 template <typename T>
1957 inline bool point_in_rectangle(const point2d<T>& point,
1958  const rectangle<T>& rectangle);
1959 
1960 template <typename T>
1961 inline bool point_in_rectangle(const point2d<T>& point,
1962  const point2d<T>& rect_point1,
1963  point2d<T>& rect_point2);
1964 
1965 template <typename T>
1966 inline bool point_in_rectangle(const point2d<T>& point,
1967  const segment<T, 2>& segment);
1968 
1969 template <typename T>
1970 inline bool point_in_box(const T& px, const T& py, const T& pz, const T& x1,
1971  const T& y1, const T& z1, const T& x2, const T& y2,
1972  const T& z2);
1973 
1974 template <typename T>
1975 inline bool point_in_box(const point3d<T>& point, const T& x1, const T& y1,
1976  const T& z1, const T& x2, const T& y2, const T& z2);
1977 
1978 template <typename T>
1979 inline bool point_in_box(const T& px, const T& py, const T& pz,
1980  const box<T, 3>& box);
1981 
1982 template <typename T>
1983 inline bool point_in_box(const point3d<T>& point, const box<T, 3>& box);
1984 
1985 template <typename T>
1986 inline bool point_in_box(const point3d<T>& point, const point3d<T>& box_point1,
1987  const point3d<T>& box_point2);
1988 
1989 template <typename T>
1990 inline bool point_in_box(const point3d<T>& point, const segment<T, 3>& segment);
1991 
1992 template <typename T>
1993 inline bool point_in_triangle(const T& px, const T& py, const T& x1,
1994  const T& y1, const T& x2, const T& y2,
1995  const T& x3, const T& y3);
1996 template <typename T>
1997 inline bool point_in_triangle(const point2d<T>& point, const point2d<T>& point1,
1998  const point2d<T>& point2,
1999  const point2d<T>& point3);
2000 
2001 template <typename T>
2002 inline bool point_in_triangle(const T& px, const T& py,
2003  const triangle<T, 2>& triangle);
2004 
2005 template <typename T>
2006 inline bool point_in_triangle(const point2d<T>& point,
2007  const triangle<T, 2>& triangle);
2008 
2009 template <typename T>
2010 inline bool point_in_quadix(const T& px, const T& py, const T& x1, const T& y1,
2011  const T& x2, const T& y2, const T& x3, const T& y3,
2012  const T& x4, const T& y4);
2013 
2014 template <typename T>
2015 inline bool point_in_quadix(const point2d<T>& point, const point2d<T>& point1,
2016  const point2d<T>& point2, const point2d<T>& point3,
2017  const point2d<T>& point4);
2018 
2019 template <typename T>
2020 inline bool point_in_quadix(const T& px, const T& py,
2021  const quadix<T, 2>& quadix);
2022 template <typename T>
2023 inline bool point_in_quadix(const point2d<T>& point,
2024  const quadix<T, 2>& quadix);
2025 
2026 template <typename T>
2027 inline bool point_in_circle(const T& px, const T& py, const T& cx, const T& cy,
2028  const T& radius);
2029 
2030 template <typename T>
2031 inline bool point_in_circle(const T& px, const T& py, const circle<T>& circle);
2032 
2033 template <typename T>
2034 inline bool point_in_circle(const point2d<T>& point, const circle<T>& circle);
2035 
2036 template <typename T>
2037 inline bool point_in_sphere(const T& px, const T& py, const T& pz, const T& cx,
2038  const T& cy, const T& cz, const T& radius);
2039 
2040 template <typename T>
2041 inline bool point_in_sphere(const T& px, const T& py, const T& pz,
2042  const sphere<T>& sphere);
2043 
2044 template <typename T>
2045 inline bool point_in_sphere(const point3d<T>& point, const sphere<T>& sphere);
2046 
2047 template <typename T>
2048 inline bool point_in_three_point_circle(const T& px, const T& py, const T& x1,
2049  const T& y1, const T& x2, const T& y2,
2050  const T& x3, const T& y3);
2051 
2052 template <typename T>
2053 inline bool point_in_three_point_circle(const point2d<T>& point,
2054  const point2d<T>& point1,
2055  const point2d<T>& point2,
2056  const point2d<T>& point3);
2057 
2058 template <typename T>
2059 inline bool point_in_three_point_circle(const point2d<T>& point,
2060  const triangle<T, 2> triangle);
2061 
2062 template <typename T>
2063 inline bool point_in_focus_area(const T& px, const T& py, const T& x1,
2064  const T& y1, const T& x2, const T& y2,
2065  const T& x3, const T& y3);
2066 template <typename T>
2067 inline bool point_in_focus_area(const point2d<T>& point,
2068  const point2d<T>& point1,
2069  const point2d<T>& point2,
2070  const point2d<T>& point3);
2071 
2072 template <typename T>
2073 inline bool point_on_segment(const point2d<T>& point,
2074  const segment<T, 2>& segment);
2075 
2076 template <typename T>
2077 inline bool point_on_segment(const point3d<T>& point,
2078  const segment<T, 3>& segment);
2079 
2080 template <typename T>
2081 inline bool point_on_ray(const T& px, const T& py, const T& ox, const T& oy,
2082  const T& dx, const T& dy);
2083 
2084 template <typename T>
2085 inline bool point_on_ray(const T& px, const T& py, const T& pz, const T& ox,
2086  const T& oy, const T& oz, const T& dx, const T& dy,
2087  const T& dz);
2088 
2089 template <typename T>
2090 inline bool point_on_ray(const point2d<T>& point, const ray<T, 2>& ray);
2091 
2092 template <typename T>
2093 inline bool point_on_ray(const point3d<T>& point, const ray<T, 3>& ray);
2094 
2095 template <typename T>
2096 inline bool point_on_rectangle(const T& px, const T& py, const T& x1,
2097  const T& y1, const T& x2, const T& y2);
2098 
2099 template <typename T>
2100 inline bool point_on_rectangle(const point2d<T>& point, const T& x1,
2101  const T& y1, const T& x2, const T& y2);
2102 
2103 template <typename T>
2104 inline bool point_on_rectangle(const T& px, const T& py,
2105  const rectangle<T>& rectangle);
2106 
2107 template <typename T>
2108 inline bool point_on_rectangle(const point2d<T>& point,
2109  const rectangle<T>& rectangle);
2110 
2111 template <typename T>
2112 inline bool point_on_triangle(const T& px, const T& py, const T& x1,
2113  const T& y1, const T& x2, const T& y2,
2114  const T& x3, const T& y3);
2115 template <typename T>
2116 inline bool point_on_triangle(const point2d<T>& point, const point2d<T>& point1,
2117  const point2d<T>& point2,
2118  const point2d<T>& point3);
2119 
2120 template <typename T>
2121 inline bool point_on_triangle(const T& px, const T& py,
2122  const triangle<T, 2>& triangle);
2123 
2124 template <typename T>
2125 inline bool point_on_triangle(const point2d<T>& point,
2126  const triangle<T, 2>& triangle);
2127 
2128 template <typename T>
2129 inline bool point_on_quadix(const T& px, const T& py, const T& x1, const T& y1,
2130  const T& x2, const T& y2, const T& x3, const T& y3,
2131  const T& x4, const T& y4);
2132 
2133 template <typename T>
2134 inline bool point_on_quadix(const point2d<T>& point, const point2d<T>& point1,
2135  const point2d<T>& point2, const point2d<T>& point3,
2136  const point2d<T>& point4);
2137 
2138 template <typename T>
2139 inline bool point_on_quadix(const T& px, const T& py,
2140  const quadix<T, 2>& quadix);
2141 template <typename T>
2142 inline bool point_on_quadix(const point2d<T>& point,
2143  const quadix<T, 2>& quadix);
2144 
2145 template <typename T>
2146 inline bool point_on_circle(const T& px, const T& py, const T& cx, const T& cy,
2147  const T& radius);
2148 
2149 template <typename T>
2150 inline bool point_on_circle(const T& px, const T& py, const circle<T>& circle);
2151 
2152 template <typename T>
2153 inline bool point_on_circle(const point2d<T>& point, const circle<T>& circle);
2154 
2155 template <typename T>
2156 inline bool point_on_bezier(const point2d<T>& point,
2157  const quadratic_bezier<T, 2>& bezier,
2158  const std::size_t& steps = 1000,
2159  const T& fuzzy = T(Epsilon));
2160 
2161 template <typename T>
2162 inline bool point_on_bezier(const point2d<T>& point,
2163  const cubic_bezier<T, 2>& bezier,
2164  const std::size_t& steps = 1000,
2165  const T& fuzzy = T(Epsilon));
2166 
2167 template <typename T>
2168 inline bool point_on_bezier(const point3d<T>& point,
2169  const quadratic_bezier<T, 3>& bezier,
2170  const std::size_t& steps = 1000,
2171  const T& fuzzy = T(Epsilon));
2172 
2173 template <typename T>
2174 inline bool point_on_bezier(const point3d<T>& point,
2175  const cubic_bezier<T, 3>& bezier,
2176  const std::size_t& steps = 1000,
2177  const T& fuzzy = T(Epsilon));
2178 
2179 template <typename T>
2181  const triangle<T, 2>& triangle);
2182 
2183 template <typename T>
2185  const triangle<T, 3>& triangle);
2186 
2187 template <typename T>
2189  const triangle<T, 2>& triangle);
2190 
2191 template <typename T>
2193 
2194 template <typename T>
2196 
2197 template <typename T>
2198 inline void create_equilateral_triangle(const T& x1, const T& y1, const T& x2,
2199  const T& y2, T& x3, T& y3);
2200 
2201 template <typename T>
2202 inline void create_equilateral_triangle(const point2d<T>& point1,
2203  const point2d<T>& point2,
2204  point2d<T>& point3);
2205 
2206 template <typename T>
2207 inline triangle<T, 2> create_equilateral_triangle(const T& x1, const T& y1,
2208  const T& x2, const T& y2);
2209 
2210 template <typename T>
2212  const point2d<T>& point2);
2213 
2214 template <typename T>
2215 inline triangle<T, 2> create_equilateral_triangle(const T& cx, const T& cy,
2216  const T& side_length);
2217 template <typename T>
2219  const point2d<T>& center_point, const T& side_length);
2220 
2221 template <typename T>
2223  const point2d<T>& point2,
2224  const T& angle);
2225 template <typename T>
2227  const T& angle);
2228 
2229 template <typename T>
2231  const point2d<T>& point2, const T& angle1,
2232  const T& angle2);
2233 template <typename T>
2235  const T& angle1, const T& angle2);
2236 
2237 template <typename T>
2239 
2240 template <typename T>
2242  const point2d<T>& point);
2243 template <typename T>
2245  const point3d<T>& point);
2246 
2247 template <typename T>
2249  const point2d<T>& point);
2250 template <typename T>
2252  const point3d<T>& point);
2253 
2254 template <typename T>
2256  const triangle<T, 2>& triangle);
2257 template <typename T>
2259  const triangle<T, 3>& triangle);
2260 
2261 template <typename T>
2263  const triangle<T, 2>& triangle);
2264 
2265 template <typename T>
2267  const triangle<T, 2>& triangle);
2268 
2269 template <typename T>
2271  const triangle<T, 2>& triangle);
2272 
2273 template <typename T>
2275  const triangle<T, 2>& triangle);
2276 
2277 template <typename T>
2279 template <typename T>
2281 
2282 template <typename T>
2284 template <typename T>
2286 
2287 template <typename T>
2289  const point2d<T>& point);
2290 
2291 template <typename T>
2293 template <typename T>
2295 
2296 template <typename T>
2298  const triangle<T, 2>& triangle);
2299 template <typename T>
2301  const triangle<T, 3>& triangle);
2302 
2303 template <typename T>
2305  const triangle<T, 2>& triangle);
2306 
2307 template <typename T>
2309 template <typename T>
2311 
2312 template <typename T>
2314 template <typename T>
2316 
2317 template <typename T>
2319 
2320 template <typename T>
2322 template <typename T>
2324 
2325 template <typename T>
2327 
2328 template <typename T>
2330  const triangle<T, 2>& triangle, const point2d<T>& point);
2331 
2332 template <typename T>
2334  const triangle<T, 2>& triangle);
2335 
2336 template <typename T>
2338  const triangle<T, 2>& triangle);
2339 
2340 template <typename T>
2342  const wykobi::point2d<T>& p2,
2343  wykobi::point2d<T>& c1,
2344  wykobi::point2d<T>& c2);
2345 
2346 template <typename T>
2347 inline void create_equilateral_quadix(const T& x1, const T& y1, const T& x2,
2348  const T& y2, T& x3, T& y3, T& x4, T& y4);
2349 
2350 template <typename T>
2351 inline void create_equilateral_quadix(const point2d<T>& point1,
2352  const point2d<T>& point2,
2353  point2d<T>& point3, point2d<T>& point4);
2354 
2355 template <typename T>
2356 inline quadix<T, 2> create_equilateral_quadix(const T& x1, const T& y1,
2357  const T& x2, const T& y2);
2358 
2359 template <typename T>
2361  const point2d<T>& point2);
2362 
2363 template <typename T>
2365 
2366 template <typename T>
2367 inline quadix<T, 2> create_equilateral_quadix(const T& cx, const T& cy,
2368  const T& side_length);
2369 
2370 template <typename T>
2372  const T& side_length);
2373 
2374 template <typename T>
2375 inline void torricelli_point(const T& x1, const T& y1, const T& x2, const T& y2,
2376  const T& x3, const T& y3, T& px, T& py);
2377 
2378 template <typename T>
2380  const point2d<T>& point2,
2381  const point2d<T>& point3);
2382 
2383 template <typename T>
2385 
2386 template <typename T>
2387 inline bool trilateration(const T& c0x, const T& c0y, const T& c0r,
2388  const T& c1x, const T& c1y, const T& c1r,
2389  const T& c2x, const T& c2y, const T& c2r, T& px,
2390  T& py);
2391 
2392 template <typename T>
2393 inline point2d<T> trilateration(const circle<T>& c0, const circle<T>& c1,
2394  const circle<T>& c2);
2395 
2396 template <typename T>
2397 inline void incenter(const T& x1, const T& y1, const T& x2, const T& y2,
2398  const T& x3, const T& y3, T& px, T& py);
2399 
2400 template <typename T>
2401 inline void incenter(const T& x1, const T& y1, const T& z1, const T& x2,
2402  const T& y2, const T& z2, const T& x3, const T& y3,
2403  const T& z3, T& px, T& py, T& pz);
2404 
2405 template <typename T>
2406 inline point2d<T> incenter(const point2d<T>& point1, const point2d<T>& point2,
2407  const point2d<T>& point3);
2408 
2409 template <typename T>
2410 inline point3d<T> incenter(const point3d<T>& point1, const point3d<T>& point2,
2411  const point3d<T>& point3);
2412 
2413 template <typename T>
2415 
2416 template <typename T>
2418 
2419 template <typename T>
2420 inline void circumcenter(const T& x1, const T& y1, const T& x2, const T& y2,
2421  const T& x3, const T& y3, T& px, T& py);
2422 
2423 template <typename T>
2424 inline void circumcenter(const T& x1, const T& y1, const T& z1, const T& x2,
2425  const T& y2, const T& z2, const T& x3, const T& y3,
2426  const T& z3, T& px, T& py, T& pz);
2427 
2428 template <typename T>
2429 inline point2d<T> circumcenter(const point2d<T>& point1,
2430  const point2d<T>& point2,
2431  const point2d<T>& point3);
2432 
2433 template <typename T>
2434 inline point3d<T> circumcenter(const point3d<T>& point1,
2435  const point3d<T>& point2,
2436  const point3d<T>& point3);
2437 
2438 template <typename T>
2440 
2441 template <typename T>
2443 
2444 template <typename T>
2445 inline circle<T> circumcircle(const T& x1, const T& y1, const T& x2,
2446  const T& y2, const T& x3, const T& y3);
2447 
2448 template <typename T>
2449 inline circle<T> circumcircle(const point2d<T>& point1,
2450  const point2d<T>& point2,
2451  const point2d<T>& point3);
2452 
2453 template <typename T>
2455 
2456 template <typename T>
2457 inline sphere<T> circumsphere(const T& x1, const T& y1, const T& z1,
2458  const T& x2, const T& y2, const T& z2,
2459  const T& x3, const T& y3, const T& z3);
2460 
2461 template <typename T>
2462 inline sphere<T> circumsphere(const point3d<T>& point1,
2463  const point3d<T>& point2,
2464  const point3d<T>& point3);
2465 
2466 template <typename T>
2468 
2469 template <typename T>
2470 inline circle<T> inscribed_circle(const T& x1, const T& y1, const T& x2,
2471  const T& y2, const T& x3, const T& y3);
2472 
2473 template <typename T>
2475  const point2d<T>& point2,
2476  const point2d<T>& point3);
2477 
2478 template <typename T>
2480 
2481 template <typename T>
2482 inline sphere<T> inscribed_sphere(const T& x1, const T& y1, const T& z1,
2483  const T& x2, const T& y2, const T& z2,
2484  const T& x3, const T& y3, const T& z3);
2485 
2486 template <typename T>
2488  const point3d<T>& point2,
2489  const point3d<T>& point3);
2490 
2491 template <typename T>
2493 
2494 template <typename T>
2495 inline circle<T> nine_point_circle(const T& x1, const T& y1, const T& x2,
2496  const T& y2, const T& x3, const T& y3);
2497 
2498 template <typename T>
2500  const point2d<T>& point2,
2501  const point2d<T>& point3);
2502 
2503 template <typename T>
2505 
2506 template <typename T>
2508 
2509 template <typename T>
2511 
2512 template <typename T>
2514  const std::size_t& corner);
2515 
2516 template <typename T>
2518  const std::size_t& corner);
2519 
2520 template <typename T>
2521 inline circle<T> excircle(const triangle<T, 2>& triangle, const std::size_t& i);
2522 
2523 template <typename T>
2525 
2526 template <typename T>
2528 
2529 template <typename T>
2531  const circle<T>& circle2);
2532 
2533 template <typename T>
2535  const sphere<T>& sphere2);
2536 
2537 template <typename T>
2539  const point2d<T>& point, point2d<T>& point1,
2540  point2d<T>& point2);
2541 
2542 template <typename T>
2543 inline void circle_internal_tangent_lines(const circle<T>& circle0,
2544  const circle<T>& circle1,
2545  std::vector<line<T, 2> >& lines);
2546 
2547 template <typename T>
2549  const circle<T>& circle0, const circle<T>& circle1,
2550  std::vector<segment<T, 2> >& segments);
2551 
2552 template <typename T>
2553 inline void circle_outer_tangent_lines(const circle<T>& circle0,
2554  const circle<T>& circle1,
2555  std::vector<line<T, 2> >& lines);
2556 
2557 template <typename T>
2559  const circle<T>& circle0, const circle<T>& circle1,
2560  std::vector<segment<T, 2> >& segments);
2561 
2562 template <typename T>
2564  const point2d<T>& point);
2565 
2566 template <typename T>
2567 inline line<T, 2> create_line_from_bisector(const T& x1, const T& y1,
2568  const T& x2, const T& y2,
2569  const T& x3, const T& y3);
2570 
2571 template <typename T>
2572 inline segment<T, 2> create_segment_from_bisector(const T& x1, const T& y1,
2573  const T& x2, const T& y2,
2574  const T& x3, const T& y3);
2575 
2576 template <typename T>
2577 inline ray<T, 2> create_ray_from_bisector(const T& x1, const T& y1, const T& x2,
2578  const T& y2, const T& x3,
2579  const T& y3);
2580 
2581 template <typename T>
2582 inline line<T, 3> create_line_from_bisector(const T& x1, const T& y1,
2583  const T& z1, const T& x2,
2584  const T& y2, const T& z2,
2585  const T& x3, const T& y3,
2586  const T& z3);
2587 
2588 template <typename T>
2589 inline segment<T, 3> create_segment_from_bisector(const T& x1, const T& y1,
2590  const T& z1, const T& x2,
2591  const T& y2, const T& z2,
2592  const T& x3, const T& y3,
2593  const T& z3);
2594 
2595 template <typename T>
2596 inline ray<T, 3> create_ray_from_bisector(const T& x1, const T& y1, const T& z1,
2597  const T& x2, const T& y2, const T& z2,
2598  const T& x3, const T& y3,
2599  const T& z3);
2600 
2601 template <typename T>
2603  const point2d<T>& point2,
2604  const point2d<T>& point3);
2605 template <typename T>
2607  const point2d<T>& point2,
2608  const point2d<T>& point3);
2609 template <typename T>
2611  const point2d<T>& point2,
2612  const point2d<T>& point3);
2613 template <typename T>
2615  const point3d<T>& point2,
2616  const point3d<T>& point3);
2617 template <typename T>
2619  const point3d<T>& point2,
2620  const point3d<T>& point3);
2621 template <typename T>
2623  const point3d<T>& point2,
2624  const point3d<T>& point3);
2625 
2626 template <typename T>
2627 inline line<T, 2> create_perpendicular_bisector(const T& x1, const T& y1,
2628  const T& x2, const T& y2);
2629 template <typename T>
2631  const point2d<T>& point2);
2632 template <typename T>
2634 
2635 template <typename T>
2637  const line<T, 2>& line);
2638 
2639 template <typename T>
2640 inline void closest_point_on_segment_from_point(const T& x1, const T& y1,
2641  const T& x2, const T& y2,
2642  const T& px, const T& py, T& nx,
2643  T& ny);
2644 
2645 template <typename T>
2647  const T& x1, const T& y1, const T& z1, const T& x2, const T& y2,
2648  const T& z2, const T& px, const T& py, const T& pz, T& nx, T& ny, T& nz);
2649 
2650 template <typename T>
2651 inline void closest_point_on_line_from_point(const T& x1, const T& y1,
2652  const T& x2, const T& y2,
2653  const T& px, const T& py, T& nx,
2654  T& ny);
2655 
2656 template <typename T>
2657 inline void closest_point_on_line_from_point(const T& x1, const T& y1,
2658  const T& z1, const T& x2,
2659  const T& y2, const T& z2,
2660  const T& px, const T& py,
2661  const T& pz, T& nx, T& ny, T& nz);
2662 
2663 template <typename T>
2665  const T& x1, const T& y1, const T& x2, const T& y2, const T& px,
2666  const T& py, T& nx, T& ny);
2667 
2668 template <typename T>
2670  const T& x1, const T& y1, const T& z1, const T& x2, const T& y2,
2671  const T& z2, const T& px, const T& py, const T& pz, T& nx, T& ny, T& nz);
2672 
2673 template <typename T>
2675  const T& x1, const T& y1, const T& x2, const T& y2, const T& px,
2676  const T& py, T& nx, T& ny);
2677 
2678 template <typename T>
2680  const T& x1, const T& y1, const T& z1, const T& x2, const T& y2,
2681  const T& z2, const T& px, const T& py, const T& pz, T& nx, T& ny, T& nz);
2682 
2683 template <typename T>
2684 inline void closest_point_on_ray_from_point(const T& ox, const T& oy,
2685  const T& dx, const T& dy,
2686  const T& px, const T& py, T& nx,
2687  T& ny);
2688 
2689 template <typename T>
2690 inline void closest_point_on_ray_from_point(const T& ox, const T& oy,
2691  const T& oz, const T& dx,
2692  const T& dy, const T& dz,
2693  const T& px, const T& py,
2694  const T& pz, T& nx, T& ny, T& nz);
2695 
2696 template <typename T>
2697 inline point2d<T> closest_point_on_segment_from_point(const T& x1, const T& y1,
2698  const T& x2, const T& y2,
2699  const T& px, const T& py);
2700 
2701 template <typename T>
2702 inline point3d<T> closest_point_on_segment_from_point(const T& x1, const T& y1,
2703  const T& z1, const T& x2,
2704  const T& y2, const T& z2,
2705  const T& px, const T& py,
2706  const T& pz);
2707 
2708 template <typename T>
2710  const segment<T, 2>& segment, const point2d<T>& point);
2711 
2712 template <typename T>
2714  const segment<T, 3>& segment, const point3d<T>& point);
2715 
2716 template <typename T>
2717 inline point2d<T> closest_point_on_line_from_point(const T& x1, const T& y1,
2718  const T& x2, const T& y2,
2719  const T& px, const T& py);
2720 
2721 template <typename T>
2722 inline point3d<T> closest_point_on_line_from_point(const T& x1, const T& y1,
2723  const T& z1, const T& x2,
2724  const T& y2, const T& z2,
2725  const T& px, const T& py,
2726  const T& pz);
2727 
2728 template <typename T>
2730  const point2d<T>& point);
2731 
2732 template <typename T>
2734  const point3d<T>& point);
2735 
2736 template <typename T>
2737 inline point2d<T> closest_point_on_ray_from_point(const T& ox, const T& oy,
2738  const T& dx, const T& dy,
2739  const T& px, const T& py);
2740 
2741 template <typename T>
2742 inline point3d<T> closest_point_on_ray_from_point(const T& ox, const T& oy,
2743  const T& oz, const T& dx,
2744  const T& dy, const T& dz,
2745  const T& px, const T& py,
2746  const T& pz);
2747 
2748 template <typename T>
2750  const point2d<T>& point);
2751 
2752 template <typename T>
2754  const point3d<T>& point);
2755 
2756 template <typename T>
2757 inline void closest_point_on_triangle_from_point(const T& x1, const T& y1,
2758  const T& x2, const T& y2,
2759  const T& x3, const T& y3,
2760  const T& px, const T& py,
2761  T& nx, T& ny);
2762 
2763 template <typename T>
2764 inline point2d<T> closest_point_on_triangle_from_point(const T& x1, const T& y1,
2765  const T& x2, const T& y2,
2766  const T& x3, const T& y3,
2767  const T& px,
2768  const T& py);
2769 
2770 template <typename T>
2772  const triangle<T, 2>& triangle, const T& px, const T& py);
2773 
2774 template <typename T>
2776  const triangle<T, 2>& triangle, const point2d<T>& point);
2777 
2778 template <typename T>
2780  const T& x1, const T& y1, const T& z1, const T& x2, const T& y2,
2781  const T& z2, const T& x3, const T& y3, const T& z3, const T& px,
2782  const T& py, const T& pz, T& nx, T& ny, T& nz);
2783 
2784 template <typename T>
2786  const T& x1, const T& y1, const T& z1, const T& x2, const T& y2,
2787  const T& z2, const T& x3, const T& y3, const T& z3, const T& px,
2788  const T& py, const T& pz);
2789 
2790 template <typename T>
2792  const triangle<T, 3>& triangle, const T& px, const T& py, const T& pz);
2793 
2794 template <typename T>
2796  const triangle<T, 3>& triangle, const point3d<T>& point);
2797 
2798 template <typename T>
2799 inline void closest_point_on_rectangle_from_point(const T& x1, const T& y1,
2800  const T& x2, const T& y2,
2801  const T& px, const T& py,
2802  T& nx, T& ny);
2803 
2804 template <typename T>
2806  const T& x1, const T& y1, const T& x2, const T& y2, const T& px,
2807  const T& py);
2808 
2809 template <typename T>
2811  const rectangle<T>& rectangle, const T& px, const T& py);
2812 
2813 template <typename T>
2815  const rectangle<T>& rectangle, const point2d<T>& point);
2816 
2817 template <typename T>
2818 inline void closest_point_on_box_from_point(const T& x1, const T& y1,
2819  const T& z1, const T& x2,
2820  const T& y2, const T& z2,
2821  const T& px, const T& py,
2822  const T& pz, T& nx, T& ny, T& nz);
2823 
2824 template <typename T>
2825 inline point3d<T> closest_point_on_box_from_point(const T& x1, const T& y1,
2826  const T& z1, const T& x2,
2827  const T& y2, const T& z2,
2828  const T& px, const T& py,
2829  const T& pz);
2830 
2831 template <typename T>
2833  const T& px, const T& py,
2834  const T& pz);
2835 
2836 template <typename T>
2838  const point3d<T>& point);
2839 
2840 template <typename T>
2841 inline void closest_point_on_quadix_from_point(const T& x1, const T& y1,
2842  const T& x2, const T& y2,
2843  const T& x3, const T& y3,
2844  const T& x4, const T& y4,
2845  const T& px, const T& py, T& nx,
2846  T& ny);
2847 
2848 template <typename T>
2849 inline point2d<T> closest_point_on_quadix_from_point(const T& x1, const T& y1,
2850  const T& x2, const T& y2,
2851  const T& x3, const T& y3,
2852  const T& x4, const T& y4,
2853  const T& px, const T& py);
2854 template <typename T>
2856  const point2d<T>& point);
2857 
2858 template <typename T>
2860  const point2d<T>& point);
2861 
2862 template <typename T>
2864  const point3d<T>& point);
2865 
2866 template <typename T>
2868  const rectangle<T>& rectangle, const point2d<T>& point);
2869 
2870 template <typename T>
2872  const circle<T>& circle, const segment<T, 2>& segment);
2873 
2874 template <typename T>
2876  const sphere<T>& sphere, const segment<T, 3>& segment);
2877 
2878 template <typename T>
2880  const point3d<T>& point);
2881 
2882 template <typename T>
2884  const quadratic_bezier<T, 2>& bezier, const point2d<T>& point,
2885  const std::size_t& steps = 1000);
2886 
2887 template <typename T>
2889  const cubic_bezier<T, 2>& bezier, const point2d<T>& point,
2890  const std::size_t& steps = 1000);
2891 
2892 template <typename T>
2894  const quadratic_bezier<T, 3>& bezier, const point3d<T>& point,
2895  const std::size_t& steps = 1000);
2896 
2897 template <typename T>
2899  const cubic_bezier<T, 3>& bezier, const point3d<T>& point,
2900  const std::size_t& steps = 1000);
2901 
2902 template <typename T>
2904  const circle<T>& circle2);
2905 
2906 template <typename T>
2908  const sphere<T>& sphere2);
2909 
2910 template <typename T>
2912  const polygon<T, 2>& polygon, const point2d<T>& point);
2913 
2914 template <typename T>
2915 inline T minimum_distance_from_point_to_segment(const T& px, const T& py,
2916  const T& x1, const T& y1,
2917  const T& x2, const T& y2);
2918 
2919 template <typename T>
2920 inline T minimum_distance_from_point_to_segment(const T& px, const T& py,
2921  const T& pz, const T& x1,
2922  const T& y1, const T& z1,
2923  const T& x2, const T& y2,
2924  const T& z2);
2925 
2926 template <typename T>
2928  const segment<T, 2>& segment);
2929 
2930 template <typename T>
2932  const segment<T, 3>& segment);
2933 
2934 template <typename T>
2935 inline T minimum_distance_from_point_to_line(const T& px, const T& py,
2936  const T& x1, const T& y1,
2937  const T& x2, const T& y2);
2938 
2939 template <typename T>
2940 inline T minimum_distance_from_point_to_line(const T& px, const T& py,
2941  const T& pz, const T& x1,
2942  const T& y1, const T& z1,
2943  const T& x2, const T& y2,
2944  const T& z2);
2945 
2946 template <typename T>
2948  const line<T, 2>& line);
2949 
2950 template <typename T>
2952  const line<T, 3>& line);
2953 
2954 template <typename T>
2955 inline T minimum_distance_from_point_to_triangle(const T& px, const T& py,
2956  const T& x1, const T& y1,
2957  const T& x2, const T& y2,
2958  const T& x3, const T& y3);
2959 
2960 template <typename T>
2962  const point2d<T>& point, const triangle<T, 2>& triangle);
2963 
2964 template <typename T>
2965 inline T minimum_distance_from_point_to_rectangle(const T& px, const T& py,
2966  const T& x1, const T& y1,
2967  const T& x2, const T& y2);
2968 
2969 template <typename T>
2971  const point2d<T>& point, const rectangle<T>& rectangle);
2972 
2973 template <typename T>
2974 inline void segment_mid_point(const T& x1, const T& y1, const T& x2,
2975  const T& y2, T& midx, T& midy);
2976 
2977 template <typename T>
2978 inline void segment_mid_point(const segment<T, 2>& segment, T& midx, T& midy);
2979 
2980 template <typename T>
2982  const point2d<T>& point2);
2983 
2984 template <typename T>
2986 
2987 template <typename T>
2988 inline void segment_mid_point(const T& x1, const T& y1, const T& z1,
2989  const T& x2, const T& y2, const T& z2, T& midx,
2990  T& midy, T& midz);
2991 
2992 template <typename T>
2993 inline void segment_mid_point(const segment<T, 3>& segment, T& midx, T& midy,
2994  T& midz);
2995 
2996 template <typename T>
2998  const point3d<T>& point2);
2999 
3000 template <typename T>
3002 
3003 template <typename T>
3004 inline void centroid(const T& x1, const T& y1, const T& x2, const T& y2, T& x,
3005  T& y);
3006 
3007 template <typename T>
3008 inline point2d<T> centroid(const point2d<T>& point1, const point2d<T>& point2);
3009 
3010 template <typename T>
3012 
3013 template <typename T>
3014 inline void centroid(const T& x1, const T& y1, const T& x2, const T& y2,
3015  const T& x3, const T& y3, T& x, T& y);
3016 
3017 template <typename T>
3018 inline void centroid(const T& x1, const T& y1, const T& z1, const T& x2,
3019  const T& y2, const T& z2, const T& x3, const T& y3,
3020  const T& z3, T& x, T& y, T& z);
3021 
3022 template <typename T>
3023 inline void centroid(const T& x1, const T& y1, const T& x2, const T& y2,
3024  const T& x3, const T& y3, const T& x4, const T& y4, T& x,
3025  T& y);
3026 
3027 template <typename T>
3028 inline void centroid(const triangle<T, 2>& triangle, T& x, T& y);
3029 template <typename T>
3030 inline void centroid(const triangle<T, 3>& triangle, T& x, T& y, T& z);
3031 template <typename T>
3032 inline void centroid(const quadix<T, 2>& quadix, T& x, T& y);
3033 template <typename T>
3034 inline void centroid(const rectangle<T>& rectangle, T& x, T& y);
3035 template <typename T>
3036 inline void centroid(const box<T, 3>& box, T& x, T& y, T& z);
3037 template <typename T>
3038 inline void centroid(const polygon<T, 2>& polygon, T& x, T& y);
3039 
3040 template <typename T>
3041 inline point2d<T> centroid(const point2d<T>& point1, const point2d<T>& point2,
3042  const point2d<T>& point3);
3043 template <typename T>
3044 inline point2d<T> centroid(const point2d<T>& point1, const point2d<T>& point2,
3045  const point2d<T>& point3, const point2d<T>& point4);
3046 template <typename T>
3048 template <typename T>
3050 template <typename T>
3052 template <typename T>
3054 template <typename T>
3056 template <typename T>
3058 
3059 template <typename T>
3060 inline bool common_center(const circle<T>& circle1, const circle<T>& circle2);
3061 template <typename T>
3062 inline bool common_center(const sphere<T>& sphere1, const sphere<T>& circle2);
3063 
3064 template <typename T>
3065 inline bool point_in_convex_polygon(const T& px, const T& py,
3066  const polygon<T, 2>& polygon);
3067 template <typename T>
3068 inline bool point_in_convex_polygon(const point2d<T>& point,
3069  const polygon<T, 2>& polygon);
3070 
3071 template <typename T>
3072 inline bool point_on_polygon_edge(const T& px, const T& py,
3073  const polygon<T, 2>& polygon);
3074 template <typename T>
3075 inline bool point_on_polygon_edge(const point2d<T>& point,
3076  const polygon<T, 2>& polygon);
3077 
3078 template <typename T>
3079 inline bool point_in_polygon(const T& px, const T& py,
3080  const polygon<T, 2>& polygon);
3081 template <typename T>
3082 inline bool point_in_polygon(const point2d<T>& point,
3083  const polygon<T, 2>& polygon);
3084 
3085 template <typename T>
3086 inline bool point_in_polygon_winding_number(const T& px, const T& py,
3087  const polygon<T, 2>& polygon);
3088 template <typename T>
3090  const polygon<T, 2>& polygon);
3091 
3092 template <typename T>
3093 inline bool convex_quadix(const quadix<T, 2>& quadix);
3094 template <typename T>
3095 inline bool convex_quadix(const quadix<T, 3>& quadix);
3096 
3097 template <typename T>
3099 
3100 template <typename T>
3102  const polygon<T, 2>& polygon);
3103 
3104 template <typename T, typename InputIterator, typename OutputIterator>
3105 inline void remove_consecutive_collinear_points(const InputIterator begin,
3106  const InputIterator end,
3107  OutputIterator out);
3108 
3109 template <typename T>
3110 inline bool convex_vertex(const std::size_t& index,
3111  const polygon<T, 2>& polygon,
3112  const int& polygon_orientation = LeftHandSide);
3113 
3114 template <typename T>
3115 inline bool collinear_vertex(const std::size_t& index,
3116  const polygon<T, 2>& polygon);
3117 
3118 template <typename T>
3119 inline bool vertex_is_ear(const std::size_t& index,
3120  const polygon<T, 2>& polygon);
3121 
3122 template <typename T>
3123 inline triangle<T, 2> vertex_triangle(const std::size_t& index,
3124  const polygon<T, 2> polygon);
3125 
3126 template <typename T>
3128 
3129 template <typename T>
3131 template <typename T>
3133 
3134 template <typename T>
3136 template <typename T>
3138 
3139 template <typename T>
3141 template <typename T>
3143 
3144 template <typename T>
3145 inline bool are_perspective_triangles(const triangle<T, 2>& triangle1,
3146  const triangle<T, 2>& triangle2);
3147 template <typename T>
3148 inline bool are_perspective_triangles(const triangle<T, 3>& triangle1,
3149  const triangle<T, 3>& triangle2);
3150 
3151 template <typename T>
3152 inline line<T, 2> perspectrix(const triangle<T, 2>& triangle1,
3153  const triangle<T, 2>& triangle2);
3154 template <typename T>
3155 inline line<T, 3> perspectrix(const triangle<T, 3>& triangle1,
3156  const triangle<T, 3>& triangle2);
3157 
3158 template <typename T>
3159 inline void mirror(const T& px, const T& py, const T& x1, const T& y1,
3160  const T& x2, const T& y2, T& nx, T& ny);
3161 
3162 template <typename T>
3163 inline void mirror(const T& px, const T& py, const T& pz, const T& x1,
3164  const T& y1, const T& z1, const T& x2, const T& y2,
3165  const T& z2, T& nx, T& ny, T& nz);
3166 
3167 template <typename T>
3168 inline point2d<T> mirror(const point2d<T>& point,
3169  const line<T, 2>& mirror_axis);
3170 template <typename T>
3172  const line<T, 2>& mirror_axis);
3173 template <typename T>
3175  const wykobi::line<T, 2>& mirror_axis);
3176 template <typename T>
3178  const line<T, 2>& mirror_axis);
3179 template <typename T>
3181  const line<T, 2>& mirror_axis);
3182 template <typename T>
3184  const line<T, 2>& mirror_axis);
3185 template <typename T>
3186 inline circle<T> mirror(const circle<T>& circle, const line<T, 2>& mirror_axis);
3187 template <typename T>
3189  const line<T, 2>& mirror_axis);
3190 
3191 template <typename T>
3192 inline point3d<T> mirror(const point3d<T>& point,
3193  const line<T, 3>& mirror_axis);
3194 template <typename T>
3196  const line<T, 3>& mirror_axis);
3197 template <typename T>
3199  const wykobi::line<T, 3>& mirror_axis);
3200 template <typename T>
3201 inline box<T, 3> mirror(const box<T, 3>& box, const line<T, 3>& mirror_axis);
3202 template <typename T>
3204  const line<T, 3>& mirror_axis);
3205 template <typename T>
3207  const line<T, 3>& mirror_axis);
3208 template <typename T>
3209 inline sphere<T> mirror(const sphere<T>& sphere, const line<T, 3>& mirror_axis);
3210 template <typename T>
3212  const line<T, 3>& mirror_axis);
3213 
3214 template <typename T>
3215 inline point3d<T> mirror(const point3d<T>& point,
3216  const plane<T, 3>& mirror_plane);
3217 template <typename T>
3219  const plane<T, 3>& mirror_plane);
3220 template <typename T>
3222  const plane<T, 3>& mirror_plane);
3223 template <typename T>
3224 inline box<T, 3> mirror(const box<T, 3>& box, const plane<T, 3>& mirror_plane);
3225 template <typename T>
3227  const plane<T, 3>& mirror_plane);
3228 template <typename T>
3230  const plane<T, 3>& mirror_plane);
3231 template <typename T>
3233  const plane<T, 3>& mirror_plane);
3234 template <typename T>
3236  const plane<T, 3>& mirror_plane);
3237 
3238 template <typename T>
3239 inline void nonsymmetric_mirror(const T& px, const T& py, const T& x1,
3240  const T& y1, const T& x2, const T& y2,
3241  const T& ratio, T& nx, T& ny);
3242 
3243 template <typename T>
3244 inline point2d<T> nonsymmetric_mirror(const point2d<T>& point, const T& ratio,
3245  const line<T, 2>& line);
3246 template <typename T>
3248  const T& ratio,
3249  const line<T, 2>& line);
3250 template <typename T>
3252  const T& ratio, const line<T, 2>& line);
3253 template <typename T>
3255  const T& ratio,
3256  const line<T, 2>& line);
3257 template <typename T>
3259  const T& ratio, const line<T, 2>& line);
3260 template <typename T>
3261 inline circle<T> nonsymmetric_mirror(const circle<T>& circle, const T& ratio,
3262  const line<T, 2>& line);
3263 template <typename T>
3265  const T& ratio,
3266  const line<T, 2>& line);
3267 
3268 template <typename T>
3269 inline point3d<T> nonsymmetric_mirror(const point3d<T>& point, const T& ratio,
3270  const plane<T, 3>& plane);
3271 template <typename T>
3273  const T& ratio,
3274  const plane<T, 3>& plane);
3275 template <typename T>
3276 inline box<T, 3> nonsymmetric_mirror(const box<T, 3>& box, const T& ratio,
3277  const plane<T, 3>& plane);
3278 template <typename T>
3280  const T& ratio,
3281  const plane<T, 3>& plane);
3282 template <typename T>
3284  const T& ratio,
3285  const plane<T, 3>& plane);
3286 template <typename T>
3287 inline circle<T> nonsymmetric_mirror(const sphere<T>& sphere, const T& ratio,
3288  const plane<T, 3>& plane);
3289 template <typename T>
3291  const T& ratio,
3292  const plane<T, 3>& plane);
3293 
3294 template <typename T>
3295 inline point2d<T> invert_point(const point2d<T>& point,
3296  const circle<T>& circle);
3297 template <typename T>
3298 inline point3d<T> invert_point(const point3d<T>& point,
3299  const sphere<T>& sphere);
3300 
3301 template <typename T>
3303  const circle<T>& circle);
3304 template <typename T>
3306  const sphere<T>& sphere);
3307 
3308 template <typename T>
3309 inline T distance(const T& x1, const T& y1, const T& x2, const T& y2);
3310 template <typename T>
3311 inline T distance(const T& x1, const T& y1, const T& z1, const T& x2,
3312  const T& y2, const T& z2);
3313 template <typename T>
3314 inline T distance(const point2d<T>& point1, const point2d<T>& point2);
3315 template <typename T>
3316 inline T distance(const point3d<T>& point1, const point3d<T>& point2);
3317 template <typename T>
3318 inline T distance(const curve_point<T, 2>& point1,
3319  const curve_point<T, 2>& point2);
3320 template <typename T>
3321 inline T distance(const curve_point<T, 3>& point1,
3322  const curve_point<T, 3>& point2);
3323 template <typename T>
3324 inline T distance(const point2d<T>& point, const segment<T, 2>& segment);
3325 template <typename T>
3326 inline T distance(const point3d<T>& point, const segment<T, 3>& segment);
3327 template <typename T>
3328 inline T distance(const point2d<T>& point, const rectangle<T>& rectangle);
3329 template <typename T>
3330 inline T distance(const point2d<T>& point, const triangle<T, 2>& triangle);
3331 template <typename T>
3332 inline T distance(const point2d<T>& point, const quadix<T, 2>& quadix);
3333 template <typename T>
3334 inline T distance(const point2d<T>& point, const ray<T, 2>& ray);
3335 template <typename T>
3336 inline T distance(const point3d<T>& point, const ray<T, 3>& ray);
3337 template <typename T>
3338 inline T distance(const point3d<T>& point, const plane<T, 3>& plane);
3339 template <typename T>
3340 inline T distance(const line<T, 2>& line1, const line<T, 2>& line2);
3341 template <typename T>
3342 inline T distance(const line<T, 3>& line1, const line<T, 3>& line2);
3343 template <typename T>
3344 inline T distance(const segment<T, 2>& segment1, const segment<T, 2>& segment2);
3345 template <typename T>
3346 inline T distance(const segment<T, 3>& segment1, const segment<T, 3>& segment2);
3347 template <typename T>
3348 inline T distance(const segment<T, 2>& segment);
3349 template <typename T>
3350 inline T distance(const segment<T, 3>& segment);
3351 template <typename T>
3353 template <typename T>
3355 template <typename T>
3357 template <typename T>
3358 inline T distance(const segment<T, 2>& segment, const circle<T>& circle);
3359 template <typename T>
3360 inline T distance(const triangle<T, 2>& triangle1,
3361  const triangle<T, 2>& triangle2);
3362 template <typename T>
3364  const rectangle<T>& rectangle);
3365 template <typename T>
3366 inline T distance(const rectangle<T>& rectangle1,
3367  const rectangle<T>& rectangle2);
3368 template <typename T>
3370 template <typename T>
3372 template <typename T>
3373 inline T distance(const point2d<T>& point, const circle<T>& circle);
3374 template <typename T>
3375 inline T distance(const circle<T>& circle1, const circle<T>& circle2);
3376 template <typename T>
3377 inline T distance(const sphere<T>& sphere1, const sphere<T>& sphere2);
3378 
3379 template <typename T>
3380 inline T lay_distance(const T& x1, const T& y1, const T& x2, const T& y2);
3381 template <typename T>
3382 inline T lay_distance(const T& x1, const T& y1, const T& z1, const T& x2,
3383  const T& y2, const T& z2);
3384 template <typename T>
3385 inline T lay_distance(const point2d<T>& point1, const point2d<T>& point2);
3386 template <typename T>
3387 inline T lay_distance(const point3d<T>& point1, const point3d<T>& point2);
3388 template <typename T>
3389 inline T lay_distance(const point2d<T>& point, const triangle<T, 2>& triangle);
3390 template <typename T>
3391 inline T lay_distance(const point2d<T>& point, const quadix<T, 2>& triangle);
3392 template <typename T>
3393 inline T lay_distance(const point2d<T>& point, const ray<T, 2>& ray);
3394 template <typename T>
3395 inline T lay_distance(const point3d<T>& point, const ray<T, 3>& ray);
3396 template <typename T>
3397 inline T lay_distance(const point3d<T>& point, const plane<T, 3>& plane);
3398 template <typename T>
3399 inline T lay_distance(const segment<T, 2>& segment1,
3400  const segment<T, 2>& segment2);
3401 template <typename T>
3402 inline T lay_distance(const segment<T, 3>& segment1,
3403  const segment<T, 3>& segment2);
3404 template <typename T>
3405 inline T lay_distance(const line<T, 3>& line1, const line<T, 3>& line2);
3406 template <typename T>
3408 template <typename T>
3410 template <typename T>
3412  const triangle<T, 2>& triangle);
3413 template <typename T>
3415  const triangle<T, 3>& triangle);
3416 
3417 template <typename T>
3418 inline T manhattan_distance(const T& x1, const T& y1, const T& x2, const T& y2);
3419 template <typename T>
3420 inline T manhattan_distance(const T& x1, const T& y1, const T& z1, const T& x2,
3421  const T& y2, const T& z2);
3422 template <typename T>
3423 inline T manhattan_distance(const point2d<T>& point1, const point2d<T>& point2);
3424 template <typename T>
3425 inline T manhattan_distance(const point3d<T>& point1, const point3d<T>& point2);
3426 template <typename T>
3427 inline T manhattan_distance(const point2d<T>& point, const ray<T, 2>& ray);
3428 template <typename T>
3429 inline T manhattan_distance(const point3d<T>& point, const ray<T, 3>& ray);
3430 template <typename T>
3432 template <typename T>
3434 template <typename T>
3435 inline T manhattan_distance(const circle<T>& circle1, const circle<T>& circle2);
3436 
3437 template <typename T>
3438 inline T chebyshev_distance(const T& x1, const T& y1, const T& x2, const T& y2);
3439 template <typename T>
3440 inline T chebyshev_distance(const T& x1, const T& y1, const T& z1, const T& x2,
3441  const T& y2, const T& z2);
3442 template <typename T>
3443 inline T chebyshev_distance(const point2d<T>& point1, const point2d<T>& point2);
3444 template <typename T>
3445 inline T chebyshev_distance(const point3d<T>& point1, const point3d<T>& point2);
3446 template <typename T>
3448 template <typename T>
3450 template <typename T>
3451 inline T chebyshev_distance(const circle<T>& circle1, const circle<T>& circle2);
3452 
3453 template <typename T>
3454 inline T inverse_chebyshev_distance(const T& x1, const T& y1, const T& x2,
3455  const T& y2);
3456 template <typename T>
3457 inline T inverse_chebyshev_distance(const T& x1, const T& y1, const T& z1,
3458  const T& x2, const T& y2, const T& z2);
3459 template <typename T>
3461  const point2d<T>& point2);
3462 template <typename T>
3464  const point3d<T>& point2);
3465 template <typename T>
3467 template <typename T>
3469 template <typename T>
3470 inline T inverse_chebyshev_distance(const circle<T>& circle1,
3471  const circle<T>& circle2);
3472 
3473 template <typename T>
3474 inline point2d<T> minkowski_sum(const point2d<T>& point1,
3475  const point2d<T>& point2);
3476 template <typename T>
3477 inline polygon<T, 2> minkowski_sum(const rectangle<T>& rectangle1,
3478  const rectangle<T>& rectangle2);
3479 template <typename T>
3481  const triangle<T, 2>& triangle2);
3482 template <typename T>
3484  const quadix<T, 2>& quadix2);
3485 template <typename T>
3487  const circle<T>& circle);
3488 
3489 template <typename T>
3491  const rectangle<T>& rectangle);
3492 template <typename T>
3494  const quadix<T, 2>& quadix);
3495 template <typename T>
3497  const circle<T>& circle);
3498 template <typename T>
3500  const circle<T>& circle);
3501 template <typename T>
3503  const rectangle<T>& rectangle);
3504 template <typename T>
3506  const circle<T>& circle);
3507 template <typename T>
3509  const polygon<T, 2>& polygon2);
3510 
3511 template <typename T>
3513  const point2d<T>& point2);
3514 template <typename T>
3516  const rectangle<T>& rectangle2);
3517 template <typename T>
3519  const triangle<T, 2>& triangle2);
3520 template <typename T>
3522  const quadix<T, 2>& quadix2);
3523 template <typename T>
3525  const circle<T>& circle);
3526 
3527 template <typename T>
3529  const rectangle<T>& rectangle);
3530 template <typename T>
3532  const quadix<T, 2>& quadix);
3533 template <typename T>
3535  const circle<T>& circle);
3536 template <typename T>
3538  const circle<T>& circle);
3539 template <typename T>
3541  const rectangle<T>& rectangle);
3542 template <typename T>
3544  const circle<T>& circle);
3545 template <typename T>
3547  const polygon<T, 2>& polygon2);
3548 
3549 template <typename T>
3550 inline T distance_segment_to_segment(const T& x1, const T& y1, const T& x2,
3551  const T& y2, const T& x3, const T& y3,
3552  const T& x4, const T& y4);
3553 
3554 template <typename T>
3555 inline T distance_segment_to_segment(const T& x1, const T& y1, const T& z1,
3556  const T& x2, const T& y2, const T& z2,
3557  const T& x3, const T& y3, const T& z3,
3558  const T& x4, const T& y4, const T& z4);
3559 
3560 template <typename T>
3561 inline T lay_distance_segment_to_segment(const T& x1, const T& y1, const T& x2,
3562  const T& y2, const T& x3, const T& y3,
3563  const T& x4, const T& y4);
3564 
3565 template <typename T>
3566 inline T lay_distance_segment_to_segment(const T& x1, const T& y1, const T& z1,
3567  const T& x2, const T& y2, const T& z2,
3568  const T& x3, const T& y3, const T& z3,
3569  const T& x4, const T& y4, const T& z4);
3570 
3571 template <typename T>
3572 inline T distance_line_to_line(const T& x1, const T& y1, const T& x2,
3573  const T& y2, const T& x3, const T& y3,
3574  const T& x4, const T& y4);
3575 
3576 template <typename T>
3577 inline T distance_line_to_line(const T& x1, const T& y1, const T& z1,
3578  const T& x2, const T& y2, const T& z2,
3579  const T& x3, const T& y3, const T& z3,
3580  const T& x4, const T& y4, const T& z4);
3581 
3582 template <typename T>
3583 inline T lay_distance_line_to_line(const T& x1, const T& y1, const T& x2,
3584  const T& y2, const T& x3, const T& y3,
3585  const T& x4, const T& y4);
3586 
3587 template <typename T>
3588 inline T lay_distance_line_to_line(const T& x1, const T& y1, const T& z1,
3589  const T& x2, const T& y2, const T& z2,
3590  const T& x3, const T& y3, const T& z3,
3591  const T& x4, const T& y4, const T& z4);
3592 
3593 template <typename T>
3595  const circle<T>& circle);
3596 
3597 template <typename T>
3599  const sphere<T>& sphere);
3600 
3601 template <typename T>
3603  const circle<T>& circle);
3604 
3605 template <typename T>
3607  const sphere<T>& sphere);
3608 
3609 template <typename T>
3611 
3612 template <typename T>
3613 inline T span_length(const box<T, 3>& box);
3614 
3615 template <typename T>
3616 inline void project_point_t(const T& srcx, const T& srcy, const T& destx,
3617  const T& desty, const T& t, T& nx, T& ny);
3618 
3619 template <typename T>
3620 inline void project_point_t(const T& srcx, const T& srcy, const T& srcz,
3621  const T& destx, const T& desty, const T& destz,
3622  const T& t, T& nx, T& ny, T& nz);
3623 
3624 template <typename T>
3625 inline void project_point(const T& srcx, const T& srcy, const T& destx,
3626  const T& desty, const T& dist, T& nx, T& ny);
3627 
3628 template <typename T>
3629 inline void project_point(const T& srcx, const T& srcy, const T& srcz,
3630  const T& destx, const T& desty, const T& destz,
3631  const T& dist, T& nx, T& ny, T& nz);
3632 
3633 template <typename T>
3634 inline void project_point(const T& px, const T& py, const T& angle,
3635  const T& distance, T& nx, T& ny);
3636 
3637 template <typename T>
3638 inline void project_point0(const T& px, const T& py, const T& distance, T& nx,
3639  T& ny);
3640 template <typename T>
3641 inline void project_point45(const T& px, const T& py, const T& distance, T& nx,
3642  T& ny);
3643 template <typename T>
3644 inline void project_point90(const T& px, const T& py, const T& distance, T& nx,
3645  T& ny);
3646 template <typename T>
3647 inline void project_point135(const T& px, const T& py, const T& distance, T& nx,
3648  T& ny);
3649 template <typename T>
3650 inline void project_point180(const T& px, const T& py, const T& distance, T& nx,
3651  T& ny);
3652 template <typename T>
3653 inline void project_point225(const T& px, const T& py, const T& distance, T& nx,
3654  T& ny);
3655 template <typename T>
3656 inline void project_point270(const T& px, const T& py, const T& distance, T& nx,
3657  T& ny);
3658 template <typename T>
3659 inline void project_point315(const T& px, const T& py, const T& distance, T& nx,
3660  T& ny);
3661 
3662 template <typename T>
3663 inline point2d<T> project_point_t(const point2d<T>& source_point,
3664  const point2d<T>& destination_point,
3665  const T& t);
3666 
3667 template <typename T>
3668 inline point3d<T> project_point_t(const point3d<T>& source_point,
3669  const point3d<T>& destination_point,
3670  const T& t);
3671 
3672 template <typename T>
3673 inline point2d<T> project_point(const point2d<T>& source_point,
3674  const point2d<T>& destination_point,
3675  const T& distance);
3676 
3677 template <typename T>
3678 inline point3d<T> project_point(const point3d<T>& source_point,
3679  const point3d<T>& destination_point,
3680  const T& distance);
3681 
3682 template <typename T>
3683 inline point2d<T> project_point(const point2d<T>& point, const T& angle,
3684  const T& distance);
3685 
3686 template <typename T>
3687 inline point2d<T> project_point0(const point2d<T>& point, const T& distance);
3688 template <typename T>
3689 inline point2d<T> project_point45(const point2d<T>& point, const T& distance);
3690 template <typename T>
3691 inline point2d<T> project_point90(const point2d<T>& point, const T& distance);
3692 template <typename T>
3693 inline point2d<T> project_point135(const point2d<T>& point, const T& distance);
3694 template <typename T>
3695 inline point2d<T> project_point180(const point2d<T>& point, const T& distance);
3696 template <typename T>
3697 inline point2d<T> project_point225(const point2d<T>& point, const T& distance);
3698 template <typename T>
3699 inline point2d<T> project_point270(const point2d<T>& point, const T& distance);
3700 template <typename T>
3701 inline point2d<T> project_point315(const point2d<T>& point, const T& distance);
3702 
3703 template <typename T>
3704 inline point2d<T> project_object(const point2d<T>& point, const T& angle,
3705  const T& distance);
3706 template <typename T>
3708  const T& angle, const T& distance);
3709 template <typename T>
3711  const T& angle, const T& distance);
3712 template <typename T>
3713 inline quadix<T, 2> project_object(const quadix<T, 2>& quadix, const T& angle,
3714  const T& distance);
3715 template <typename T>
3716 inline circle<T> project_object(const circle<T>& circle, const T& angle,
3717  const T& distance);
3718 template <typename T>
3720  const T& angle, const T& distance);
3721 
3722 template <typename T>
3724  const line<T, 2>& axis);
3725 template <typename T>
3727  const line<T, 2>& axis);
3728 template <typename T>
3730  const line<T, 2>& axis);
3731 template <typename T>
3733  const line<T, 2>& axis);
3734 template <typename T>
3736  const line<T, 2>& axis);
3737 template <typename T>
3739  const line<T, 2>& axis);
3740 
3741 template <typename T>
3743  const line<T, 3>& axis);
3744 template <typename T>
3746  const line<T, 3>& axis);
3747 template <typename T>
3749  const line<T, 3>& axis);
3750 template <typename T>
3752  const line<T, 3>& axis);
3753 template <typename T>
3755  const line<T, 3>& axis);
3756 template <typename T>
3758  const line<T, 3>& axis);
3759 
3760 template <typename T>
3762  T& ax, T& bx, T& ay, T& by);
3763 template <typename T>
3765  T& ax, T& bx, T& ay, T& by, T& az,
3766  T& bz);
3767 template <typename T>
3769  T& ax, T& bx, T& cx, T& ay, T& by,
3770  T& cy);
3771 template <typename T>
3773  T& ax, T& bx, T& cx, T& ay, T& by,
3774  T& cy, T& az, T& bz, T& cz);
3775 
3776 template <typename T>
3778  const quadratic_bezier<T, 2>& bezier,
3780 
3781 template <typename T>
3783  const quadratic_bezier<T, 3>& bezier,
3785 
3786 template <typename T>
3788  const cubic_bezier<T, 2>& bezier,
3790 
3791 template <typename T>
3793  const cubic_bezier<T, 3>& bezier,
3795 
3796 template <typename T>
3798  const T& ax, const T& bx, const T& ay,
3799  const T& by, const T& t);
3800 
3801 template <typename T>
3803  const T& ax, const T& bx, const T& ay,
3804  const T& by, const T& az, const T& bz,
3805  const T& t);
3806 
3807 template <typename T>
3809  const T& ax, const T& bx, const T& cx,
3810  const T& ay, const T& by, const T& cy,
3811  const T& t);
3812 
3813 template <typename T>
3815  const T& ax, const T& bx, const T& cx,
3816  const T& ay, const T& by, const T& cy,
3817  const T& az, const T& bz, const T& cz,
3818  const T& t);
3819 
3820 template <typename T>
3822  const point2d<T>& start_point,
3823  const bezier_coefficients<T, 2, eQuadraticBezier>& coeffs, const T& t);
3824 
3825 template <typename T>
3827  const point3d<T>& start_point,
3828  const bezier_coefficients<T, 3, eQuadraticBezier>& coeffs, const T& t);
3829 
3830 template <typename T>
3832  const point2d<T>& start_point,
3833  const bezier_coefficients<T, 2, eCubicBezier>& coeffs, const T& t);
3834 
3835 template <typename T>
3837  const point3d<T>& start_point,
3838  const bezier_coefficients<T, 3, eCubicBezier>& coeffs, const T& t);
3839 
3840 template <typename T, typename OutputIterator>
3841 inline void generate_bezier(const quadratic_bezier<T, 2>& bezier,
3842  OutputIterator out,
3843  const std::size_t& point_count = 1000);
3844 template <typename T, typename OutputIterator>
3845 inline void generate_bezier(const quadratic_bezier<T, 3>& bezier,
3846  OutputIterator out,
3847  const std::size_t& point_count = 1000);
3848 template <typename T, typename OutputIterator>
3849 inline void generate_bezier(const cubic_bezier<T, 2>& bezier,
3850  OutputIterator out,
3851  const std::size_t& point_count = 1000);
3852 template <typename T, typename OutputIterator>
3853 inline void generate_bezier(const cubic_bezier<T, 3>& bezier,
3854  OutputIterator out,
3855  const std::size_t& point_count = 1000);
3856 
3857 template <typename T>
3859  const std::size_t& point_count);
3860 template <typename T>
3862  const std::size_t& point_count);
3863 template <typename T>
3865  const std::size_t& point_count);
3866 template <typename T>
3868  const std::size_t& point_count);
3869 
3870 template <typename T>
3872 template <typename T>
3874 
3875 template <typename T>
3877  const T& x, const T& y);
3878 template <typename T>
3880  const T& x, const T& y, const T& z);
3881 template <typename T>
3883  const T& x, const T& y);
3884 template <typename T>
3886  const T& x, const T& y);
3887 template <typename T>
3888 inline box<T, 3> center_at_location(const box<T, 3>& box, const T& x,
3889  const T& y, const T& z);
3890 template <typename T>
3892  const T& y);
3893 template <typename T>
3894 inline circle<T> center_at_location(const circle<T>& circle, const T& x,
3895  const T& y);
3896 template <typename T>
3898  const T& x, const T& y);
3899 
3900 template <typename T>
3902  const point2d<T>& center_point);
3903 template <typename T>
3905  const point3d<T>& center_point);
3906 template <typename T>
3908  const point2d<T>& center_point);
3909 template <typename T>
3911  const point2d<T>& center_point);
3912 template <typename T>
3914  const point3d<T>& center_point);
3915 template <typename T>
3917  const point2d<T>& center_point);
3918 template <typename T>
3920  const point2d<T>& center_point);
3921 template <typename T>
3923  const point2d<T>& center_point);
3924 
3925 template <typename T>
3926 inline void shorten_segment(T& x1, T& y1, T& x2, T& y2, const T& amount);
3927 template <typename T>
3928 inline void shorten_segment(T& x1, T& y1, T& z1, T& x2, T& y2, T& z2,
3929  const T& amount);
3930 template <typename T>
3932  const T& amount);
3933 template <typename T>
3935  const T& amount);
3936 
3937 template <typename T>
3938 inline void lengthen_segment(T& x1, T& y1, T& x2, T& y2, const T& amount);
3939 template <typename T>
3940 inline void lengthen_segment(T& x1, T& y1, T& z1, T& x2, T& y2, T& z2,
3941  const T& amount);
3942 template <typename T>
3944  const T& amount);
3945 template <typename T>
3947  const T& amount);
3948 
3949 template <typename T>
3950 inline int out_code(const point2d<T>& point, const rectangle<T>& rectangle);
3951 
3952 template <typename T>
3953 inline bool clip(const T& x1, const T& y1, const T& x2, const T& y2,
3954  const T& x3, const T& y3, const T& x4, const T& y4, T& cx1,
3955  T& cy1, T& cx2, T& cy2);
3956 
3957 template <typename T>
3958 inline bool clip(const T& x1, const T& y1, const T& z1, const T& x2,
3959  const T& y2, const T& z2, const T& x3, const T& y3,
3960  const T& z3, const T& x4, const T& y4, const T& z4, T& cx1,
3961  T& cy1, T& cz1, T& cx2, T& cy2, T& cz2);
3962 
3963 template <typename T>
3964 inline bool clip(const segment<T, 2>& src_segment,
3965  const rectangle<T>& rectangle, segment<T, 2>& csegment);
3966 template <typename T>
3967 inline bool clip(const segment<T, 2>& src_segment,
3968  const triangle<T, 2>& triangle, segment<T, 2>& csegment);
3969 template <typename T>
3970 inline bool clip(const segment<T, 2>& src_segment, const quadix<T, 2>& quadix,
3971  segment<T, 2>& csegment);
3972 template <typename T>
3973 inline bool clip(const segment<T, 2>& src_segment, const circle<T>& circle,
3974  segment<T, 2>& csegment);
3975 template <typename T>
3976 inline bool clip(const rectangle<T>& rectangle1, const rectangle<T>& rectangle2,
3977  rectangle<T>& crectangle);
3978 template <typename T>
3979 inline bool clip(const box<T, 3>& box1, const box<T, 3>& box2, box<T, 3>& cbox);
3980 
3981 template <typename T>
3982 inline T area(const point2d<T>& point1, const point2d<T>& point2,
3983  const point2d<T>& point3);
3984 template <typename T>
3985 inline T area(const point3d<T>& point1, const point3d<T>& point2,
3986  const point3d<T>& point3);
3987 template <typename T>
3988 inline T area(const triangle<T, 2>& triangle);
3989 template <typename T>
3990 inline T area(const triangle<T, 3>& triangle);
3991 template <typename T>
3992 inline T area(const quadix<T, 2>& quadix);
3993 template <typename T>
3994 inline T area(const quadix<T, 3>& quadix);
3995 template <typename T>
3996 inline T area(const rectangle<T>& rectangle);
3997 template <typename T>
3998 inline T area(const circle<T>& circle);
3999 template <typename T>
4000 inline T area(const polygon<T, 2>& polygon);
4001 
4002 template <typename T>
4003 inline T perimeter(const point2d<T>& point1, const point2d<T>& point2,
4004  const point2d<T>& point3);
4005 template <typename T>
4006 inline T perimeter(const point3d<T>& point1, const point3d<T>& point2,
4007  const point3d<T>& point3);
4008 template <typename T>
4010 template <typename T>
4012 template <typename T>
4013 inline T perimeter(const quadix<T, 2>& quadix);
4014 template <typename T>
4015 inline T perimeter(const quadix<T, 3>& quadix);
4016 template <typename T>
4018 template <typename T>
4019 inline T perimeter(const circle<T>& circle);
4020 template <typename T>
4022 
4023 template <typename T>
4024 inline void rotate(const T& rotation_angle, const T& x, const T& y, T& nx,
4025  T& ny);
4026 template <typename T>
4027 inline void rotate(const T& rotation_angle, const T& x, const T& y, const T& ox,
4028  const T& oy, T& nx, T& ny);
4029 
4030 template <typename T>
4031 inline point2d<T> rotate(const T& rotation_angle, const point2d<T>& point);
4032 template <typename T>
4033 inline point2d<T> rotate(const T& rotation_angle, const point2d<T>& point,
4034  const point2d<T>& opoint);
4035 
4036 template <typename T>
4037 inline segment<T, 2> rotate(const T& rotation_angle,
4038  const segment<T, 2>& segment);
4039 template <typename T>
4040 inline segment<T, 2> rotate(const T& rotation_angle,
4041  const segment<T, 2>& segment,
4042  const point2d<T>& opoint);
4043 
4044 template <typename T>
4045 inline triangle<T, 2> rotate(const T& rotation_angle,
4046  const triangle<T, 2>& triangle);
4047 template <typename T>
4048 inline triangle<T, 2> rotate(const T& rotation_angle,
4049  const triangle<T, 2>& triangle,
4050  const point2d<T>& opoint);
4051 
4052 template <typename T>
4053 inline quadix<T, 2> rotate(const T& rotation_angle, const quadix<T, 2>& quadix);
4054 template <typename T>
4055 inline quadix<T, 2> rotate(const T& rotation_angle, const quadix<T, 2>& quadix,
4056  const point2d<T>& opoint);
4057 
4058 template <typename T>
4059 inline polygon<T, 2> rotate(const T& rotation_angle,
4060  const polygon<T, 2>& polygon);
4061 template <typename T>
4062 inline polygon<T, 2> rotate(const T& rotation_angle,
4063  const polygon<T, 2>& polygon,
4064  const point2d<T>& opoint);
4065 
4066 template <typename T>
4067 inline void fast_rotate(const trig_luts<T>& lut, const int rotation_angle,
4068  const T& x, const T& y, T& nx, T& ny);
4069 
4070 template <typename T>
4071 inline void fast_rotate(const trig_luts<T>& lut, const int rotation_angle,
4072  const T& x, const T& y, const T& ox, const T& oy, T& nx,
4073  T& ny);
4074 
4075 template <typename T>
4076 inline point2d<T> fast_rotate(const trig_luts<T>& lut, const int rotation_angle,
4077  const point2d<T>& point);
4078 template <typename T>
4079 inline point2d<T> fast_rotate(const trig_luts<T>& lut, const int rotation_angle,
4080  const point2d<T>& point,
4081  const point2d<T>& opoint);
4082 
4083 template <typename T>
4085  const int rotation_angle,
4086  const segment<T, 2>& segment);
4087 template <typename T>
4089  const int rotation_angle,
4090  const segment<T, 2>& segment,
4091  const point2d<T>& opoint);
4092 
4093 template <typename T>
4095  const int rotation_angle,
4096  const triangle<T, 2>& triangle);
4097 template <typename T>
4099  const int rotation_angle,
4100  const triangle<T, 2>& triangle,
4101  const point2d<T>& opoint);
4102 
4103 template <typename T>
4105  const int rotation_angle,
4106  const quadix<T, 2>& quadix);
4107 template <typename T>
4109  const int rotation_angle,
4110  const quadix<T, 2>& quadix,
4111  const point2d<T>& opoint);
4112 
4113 template <typename T>
4115  const int rotation_angle,
4116  const polygon<T, 2>& polygon);
4117 template <typename T>
4119  const int rotation_angle,
4120  const polygon<T, 2>& polygon,
4121  const point2d<T>& opoint);
4122 
4123 template <typename T>
4124 inline void fast_rotate(const trig_luts<T>& lut, const int rx, const int ry,
4125  const int rz, const T& x, const T& y, const T& z, T& nx,
4126  T& ny, T& nz);
4127 
4128 template <typename T>
4129 inline void fast_rotate(const trig_luts<T>& lut, const int rx, const int ry,
4130  const int rz, const T& x, const T& y, const T& z,
4131  const T& ox, const T& oy, const T& oz, T& nx, T& ny,
4132  T& nz);
4133 
4134 template <typename T>
4135 inline point3d<T> fast_rotate(const trig_luts<T>& lut, const int rx,
4136  const int ry, const int rz,
4137  const point3d<T>& point);
4138 template <typename T>
4139 inline point3d<T> fast_rotate(const trig_luts<T>& lut, const int rx,
4140  const int ry, const int rz,
4141  const point3d<T>& point,
4142  const point3d<T>& opoint);
4143 
4144 template <typename T>
4145 inline segment<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4146  const int ry, const int rz,
4147  const segment<T, 3>& segment);
4148 template <typename T>
4149 inline segment<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4150  const int ry, const int rz,
4151  const segment<T, 3>& segment,
4152  const point3d<T>& opoint);
4153 
4154 template <typename T>
4155 inline triangle<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4156  const int ry, const int rz,
4157  const triangle<T, 3>& triangle);
4158 template <typename T>
4159 inline triangle<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4160  const int ry, const int rz,
4161  const triangle<T, 3>& triangle,
4162  const point3d<T>& opoint);
4163 
4164 template <typename T>
4165 inline quadix<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4166  const int ry, const int rz,
4167  const quadix<T, 3>& quadix);
4168 template <typename T>
4169 inline quadix<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4170  const int ry, const int rz,
4171  const quadix<T, 3>& quadix,
4172  const point3d<T>& opoint);
4173 
4174 template <typename T>
4175 inline polygon<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4176  const int ry, const int rz,
4177  const polygon<T, 3>& polygon);
4178 template <typename T>
4179 inline polygon<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4180  const int ry, const int rz,
4181  const polygon<T, 3>& polygon,
4182  const point3d<T>& opoint);
4183 
4184 template <typename T>
4185 inline point2d<T> translate(const T& dx, const T& dy, const point2d<T>& point);
4186 template <typename T>
4187 inline line<T, 2> translate(const T& dx, const T& dy, const line<T, 2>& line);
4188 template <typename T>
4189 inline segment<T, 2> translate(const T& dx, const T& dy,
4190  const segment<T, 2>& segment);
4191 template <typename T>
4192 inline triangle<T, 2> translate(const T& dx, const T& dy,
4193  const triangle<T, 2>& triangle);
4194 template <typename T>
4195 inline quadix<T, 2> translate(const T& dx, const T& dy,
4196  const quadix<T, 2>& quadix);
4197 template <typename T>
4198 inline rectangle<T> translate(const T& dx, const T& dy,
4199  const rectangle<T>& rectangle);
4200 template <typename T>
4201 inline circle<T> translate(const T& dx, const T& dy, const circle<T>& circle);
4202 template <typename T>
4203 inline polygon<T, 2> translate(const T& dx, const T& dy,
4204  const polygon<T, 2>& polygon);
4205 
4206 template <typename T>
4207 inline point2d<T> translate(const T& delta, const point2d<T>& point);
4208 template <typename T>
4209 inline line<T, 2> translate(const T& delta, const line<T, 2>& line);
4210 template <typename T>
4211 inline segment<T, 2> translate(const T& delta, const segment<T, 2>& segment);
4212 template <typename T>
4213 inline triangle<T, 2> translate(const T& delta, const triangle<T, 2>& triangle);
4214 template <typename T>
4215 inline quadix<T, 2> translate(const T& delta, const quadix<T, 2>& quadix);
4216 template <typename T>
4217 inline rectangle<T> translate(const T& delta, const rectangle<T>& rectangle);
4218 template <typename T>
4219 inline circle<T> translate(const T& delta, const circle<T>& circle);
4220 template <typename T>
4221 inline polygon<T, 2> translate(const T& delta, const polygon<T, 2>& polygon);
4222 
4223 template <typename T>
4224 inline point2d<T> translate(const vector2d<T>& v, const point2d<T>& point);
4225 template <typename T>
4227 template <typename T>
4229  const segment<T, 2>& segment);
4230 template <typename T>
4232  const triangle<T, 2>& triangle);
4233 template <typename T>
4235 template <typename T>
4237  const rectangle<T>& rectangle);
4238 template <typename T>
4240 template <typename T>
4242  const polygon<T, 2>& polygon);
4243 
4244 template <typename T>
4245 inline point3d<T> translate(const T& dx, const T& dy, const T& dz,
4246  const point3d<T>& point);
4247 template <typename T>
4248 inline line<T, 3> translate(const T& dx, const T& dy, const T& dz,
4249  const line<T, 3>& line);
4250 template <typename T>
4251 inline segment<T, 3> translate(const T& dx, const T& dy, const T& dz,
4252  const segment<T, 3>& segment);
4253 template <typename T>
4254 inline triangle<T, 3> translate(const T& dx, const T& dy, const T& dz,
4255  const triangle<T, 3>& triangle);
4256 template <typename T>
4257 inline quadix<T, 3> translate(const T& dx, const T& dy, const T& dz,
4258  const quadix<T, 3>& quadix);
4259 template <typename T>
4260 inline box<T, 3> translate(const T& dx, const T& dy, const T& dz,
4261  const box<T, 3>& box);
4262 template <typename T>
4263 inline sphere<T> translate(const T& dx, const T& dy, const T& dz,
4264  const sphere<T>& sphere);
4265 template <typename T>
4266 inline polygon<T, 3> translate(const T& dx, const T& dy, const T& dz,
4267  const polygon<T, 3>& polygon);
4268 
4269 template <typename T>
4270 inline point3d<T> translate(const T& delta, const point3d<T>& point);
4271 template <typename T>
4272 inline line<T, 3> translate(const T& delta, const line<T, 3>& line);
4273 template <typename T>
4274 inline segment<T, 3> translate(const T& delta, const segment<T, 3>& segment);
4275 template <typename T>
4276 inline triangle<T, 3> translate(const T& delta, const triangle<T, 3>& triangle);
4277 template <typename T>
4278 inline quadix<T, 3> translate(const T& delta, const quadix<T, 3>& quadix);
4279 template <typename T>
4280 inline box<T, 3> translate(const T& delta, const box<T, 3>& box);
4281 template <typename T>
4282 inline sphere<T> translate(const T& delta, const sphere<T>& sphere);
4283 template <typename T>
4284 inline polygon<T, 3> translate(const T& delta, const polygon<T, 3>& polygon);
4285 
4286 template <typename T>
4287 inline point3d<T> translate(const vector3d<T>& v, const point3d<T>& point);
4288 template <typename T>
4290 template <typename T>
4292  const segment<T, 3>& segment);
4293 template <typename T>
4295  const triangle<T, 3>& triangle);
4296 template <typename T>
4298 template <typename T>
4299 inline box<T, 3> translate(const vector3d<T>& v, const box<T, 3>& box);
4300 template <typename T>
4302 template <typename T>
4304  const polygon<T, 3>& polygon);
4305 
4306 template <typename T>
4307 inline point2d<T> scale(const T& dx, const T& dy, const point2d<T>& point);
4308 template <typename T>
4309 inline line<T, 2> scale(const T& dx, const T& dy, const line<T, 2>& line);
4310 template <typename T>
4311 inline segment<T, 2> scale(const T& dx, const T& dy,
4312  const segment<T, 2>& segment);
4313 template <typename T>
4314 inline triangle<T, 2> scale(const T& dx, const T& dy,
4315  const triangle<T, 2>& triangle);
4316 template <typename T>
4317 inline quadix<T, 2> scale(const T& dx, const T& dy, const quadix<T, 2>& quadix);
4318 template <typename T>
4319 inline rectangle<T> scale(const T& dx, const T& dy,
4320  const rectangle<T>& rectangle);
4321 template <typename T>
4322 inline circle<T> scale(const T& dr, const circle<T>& circle);
4323 template <typename T>
4324 inline polygon<T, 2> scale(const T& dx, const T& dy,
4325  const polygon<T, 2>& polygon);
4326 
4327 template <typename T>
4328 inline point3d<T> scale(const T& dx, const T& dy, const T& dz,
4329  const point3d<T>& point);
4330 template <typename T>
4331 inline line<T, 3> scale(const T& dx, const T& dy, const T& dz,
4332  const line<T, 3>& line);
4333 template <typename T>
4334 inline segment<T, 3> scale(const T& dx, const T& dy, const T& dz,
4335  const segment<T, 3>& segment);
4336 template <typename T>
4337 inline triangle<T, 3> scale(const T& dx, const T& dy, const T& dz,
4338  const triangle<T, 3>& triangle);
4339 template <typename T>
4340 inline quadix<T, 3> scale(const T& dx, const T& dy, const T& dz,
4341  const quadix<T, 3>& quadix);
4342 template <typename T>
4343 inline box<T, 3> scale(const T& dx, const T& dy, const T& dz,
4344  const box<T, 3>& box);
4345 template <typename T>
4346 inline sphere<T> scale(const T& dr, const sphere<T>& sphere);
4347 template <typename T>
4348 inline polygon<T, 3> scale(const T& dx, const T& dy, const T& dz,
4349  const polygon<T, 3>& polygon);
4350 
4351 template <typename T>
4353 template <typename T>
4355 template <typename T>
4357 template <typename T>
4359 template <typename T>
4361 template <typename T>
4363 
4364 template <typename T>
4365 inline void aabb(const segment<T, 2>& segment, T& x1, T& y1, T& x2, T& y2);
4366 template <typename T>
4367 inline void aabb(const triangle<T, 2>& triangle, T& x1, T& y1, T& x2, T& y2);
4368 template <typename T>
4369 inline void aabb(const rectangle<T>& rectangle, T& x1, T& y1, T& x2, T& y2);
4370 template <typename T>
4371 inline void aabb(const quadix<T, 2>& quadix, T& x1, T& y1, T& x2, T& y2);
4372 template <typename T>
4373 inline void aabb(const circle<T>& circle, T& x1, T& y1, T& x2, T& y2);
4374 template <typename T>
4375 inline void aabb(const polygon<T, 2>& polygon, T& x1, T& y1, T& x2, T& y2);
4376 
4377 template <typename T>
4379 template <typename T>
4381 template <typename T>
4383 template <typename T>
4385 template <typename T>
4387 template <typename T>
4389 
4390 template <typename T>
4391 inline void aabb(const segment<T, 3>& segment, T& x1, T& y1, T& z1, T& x2,
4392  T& y2, T& z2);
4393 template <typename T>
4394 inline void aabb(const triangle<T, 3>& triangle, T& x1, T& y1, T& z1, T& x2,
4395  T& y2, T& z2);
4396 template <typename T>
4397 inline void aabb(const box<T, 3>& box, T& x1, T& y1, T& z1, T& x2, T& y2,
4398  T& z2);
4399 template <typename T>
4400 inline void aabb(const quadix<T, 3>& quadix, T& x1, T& y1, T& z1, T& x2, T& y2,
4401  T& z2);
4402 template <typename T>
4403 inline void aabb(const sphere<T>& sphere, T& x1, T& y1, T& z1, T& x2, T& y2,
4404  T& z2);
4405 template <typename T>
4406 inline void aabb(const polygon<T, 3>& polygon, T& x1, T& y1, T& z1, T& x2,
4407  T& y2, T& z2);
4408 
4409 template <typename T>
4411  point2d<T>& point);
4412 template <typename T>
4414 template <typename T>
4416 template <typename T>
4418 
4419 template <typename T>
4421  const T& t);
4422 template <typename T>
4424  const T& t);
4425 template <typename T>
4426 inline point2d<T> generate_point_on_ray(const ray<T, 2>& ray, const T& t);
4427 template <typename T>
4428 inline point3d<T> generate_point_on_ray(const ray<T, 3>& ray, const T& t);
4429 
4430 template <typename T>
4431 inline T generate_random_value(const T& range);
4432 
4433 template <typename T>
4434 inline point2d<T> generate_random_point(const T& dx, const T& dy);
4435 template <typename T>
4436 inline point3d<T> generate_random_point(const T& dx, const T& dy, const T& dz);
4437 template <typename T>
4439 template <typename T>
4441 template <typename T>
4443 template <typename T>
4445 template <typename T>
4447 template <typename T>
4449 template <typename T>
4451 template <typename T>
4453 
4454 template <typename T, typename OutputIterator>
4455 inline void generate_random_points(const T& x1, const T& y1, const T& x2,
4456  const T& y2, const std::size_t& point_count,
4457  OutputIterator out);
4458 template <typename T, typename OutputIterator>
4459 inline void generate_random_points(const T& x1, const T& y1, const T& z1,
4460  const T& x2, const T& y2, const T& z2,
4461  const std::size_t& point_count,
4462  OutputIterator out);
4463 template <typename T, typename OutputIterator>
4465  const std::size_t& point_count,
4466  OutputIterator out);
4467 template <typename T, typename OutputIterator>
4469  const std::size_t& point_count,
4470  OutputIterator out);
4471 template <typename T, typename OutputIterator>
4473  const std::size_t& point_count,
4474  OutputIterator out);
4475 template <typename T, typename OutputIterator>
4477  const std::size_t& point_count,
4478  OutputIterator out);
4479 template <typename T, typename OutputIterator>
4481  const std::size_t& point_count,
4482  OutputIterator out);
4483 template <typename T, typename OutputIterator>
4485  const std::size_t& point_count,
4486  OutputIterator out);
4487 template <typename T, typename OutputIterator>
4489  const std::size_t& point_count,
4490  OutputIterator out);
4491 template <typename T, typename OutputIterator>
4493  const std::size_t& point_count,
4494  OutputIterator out);
4495 template <typename T, typename OutputIterator>
4497  const std::size_t& point_count,
4498  OutputIterator out);
4499 
4500 template <typename T>
4501 inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4502  const T& y2, segment<T, 2>& segment);
4503 template <typename T>
4504 inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4505  const T& y2, rectangle<T>& rectangle);
4506 template <typename T>
4507 inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4508  const T& y2, triangle<T, 2>& triangle);
4509 template <typename T>
4510 inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4511  const T& y2, quadix<T, 2>& quadix);
4512 template <typename T>
4513 inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4514  const T& y2, circle<T>& circle);
4515 template <typename T>
4516 inline void generate_random_object(const T& x1, const T& y1, const T& z1,
4517  const T& x2, const T& y2, const T& z2,
4518  box<T, 3>& box);
4519 
4520 template <typename T>
4522  const std::size_t& shift);
4523 
4524 template <typename T>
4526  const std::size_t& shift);
4527 
4528 template <typename T>
4530  const std::size_t& shift);
4531 
4532 template <typename T>
4534  const std::size_t& shift);
4535 
4536 template <typename T>
4537 inline T vector_norm(const vector2d<T>& v);
4538 template <typename T>
4539 inline T vector_norm(const vector3d<T>& v);
4540 
4541 template <typename T>
4543 template <typename T>
4545 
4546 template <typename T>
4548 template <typename T>
4550 
4551 template <typename T>
4552 inline vector2d<T> operator+(const vector2d<T>& v1, const vector2d<T>& v2);
4553 template <typename T>
4554 inline vector3d<T> operator+(const vector3d<T>& v1, const vector3d<T>& v2);
4555 
4556 template <typename T>
4557 inline vector2d<T> operator-(const vector2d<T>& v1, const vector2d<T>& v2);
4558 template <typename T>
4559 inline vector3d<T> operator-(const vector3d<T>& v1, const vector3d<T>& v2);
4560 
4561 template <typename T>
4562 inline T operator*(const vector2d<T>& v1, const vector2d<T>& v2);
4563 template <typename T>
4564 inline vector3d<T> operator*(const vector3d<T>& v1, const vector3d<T>& v2);
4565 
4566 template <typename T>
4567 inline T dot_product(const vector2d<T>& v1, const vector2d<T>& v2);
4568 template <typename T>
4569 inline T dot_product(const vector3d<T>& v1, const vector3d<T>& v2);
4570 
4571 template <typename T>
4572 inline T perpendicular_product(const vector2d<T>& v1, const vector2d<T>& v2);
4573 template <typename T>
4574 inline T triple_product(const vector3d<T>& v1, const vector3d<T>& v2,
4575  const vector3d<T>& v3);
4576 
4577 template <typename T>
4578 inline vector2d<T> operator*(const vector2d<T>& v1, const T& scale);
4579 template <typename T>
4580 inline vector3d<T> operator*(const vector3d<T>& v1, const T& scale);
4581 template <typename T>
4582 inline vector2d<T> operator*(const T& scale, const vector2d<T>& v1);
4583 template <typename T>
4584 inline vector3d<T> operator*(const T& scale, const vector3d<T>& v1);
4585 
4586 template <typename T>
4587 inline vector2d<T> operator/(const vector2d<T>& v1, const T& scale);
4588 template <typename T>
4589 inline vector3d<T> operator/(const vector3d<T>& v1, const T& scale);
4590 
4591 template <typename T>
4592 inline point2d<T> operator*(const point2d<T>& point, const T& scale);
4593 template <typename T>
4594 inline point3d<T> operator*(const point3d<T>& point, const T& scale);
4595 template <typename T>
4596 inline point2d<T> operator*(const T& scale, const point2d<T>& point);
4597 template <typename T>
4598 inline point3d<T> operator*(const T& scale, const point3d<T>& point);
4599 
4600 template <typename T>
4601 inline point2d<T> operator+(const point2d<T>& point, const vector2d<T>& v);
4602 template <typename T>
4603 inline point2d<T> operator+(const vector2d<T>& v, const point2d<T>& point);
4604 
4605 template <typename T>
4606 inline point3d<T> operator+(const point3d<T>& point, const vector3d<T>& v);
4607 template <typename T>
4608 inline point3d<T> operator+(const vector3d<T>& v, const point3d<T>& point);
4609 
4610 template <typename T>
4611 inline vector2d<T> operator-(const point2d<T>& p1, const point2d<T>& p2);
4612 template <typename T>
4613 inline vector3d<T> operator-(const point3d<T>& p1, const point3d<T>& p2);
4614 
4615 template <typename T>
4616 inline point2d<T> operator+(const point2d<T>& p1, const point2d<T>& p2);
4617 template <typename T>
4618 inline point3d<T> operator+(const point3d<T>& p1, const point3d<T>& p2);
4619 
4620 template <typename T>
4621 inline bool is_equal(const T& val1, const T& val2, const T& epsilon);
4622 template <typename T>
4623 inline bool is_equal(const point2d<T>& point1, const point2d<T>& point2,
4624  const T& epsilon);
4625 template <typename T>
4626 inline bool is_equal(const point3d<T>& point1, const point3d<T>& point2,
4627  const T& epsilon);
4628 
4629 template <typename T>
4630 inline bool is_equal(const T& val1, const T& val2);
4631 template <typename T>
4632 inline bool is_equal(const point2d<T>& point1, const point2d<T>& point2);
4633 template <typename T>
4634 inline bool is_equal(const point3d<T>& point1, const point3d<T>& point2);
4635 
4636 template <typename T>
4637 inline bool is_equal(const rectangle<T>& rectangle1,
4638  const rectangle<T>& rectangle2);
4639 template <typename T>
4640 inline bool is_equal(const circle<T>& circle1, const circle<T>& circle2);
4641 
4642 template <typename T>
4643 inline bool is_equal(const box<T, 3>& box1, const box<T, 3>& box2);
4644 template <typename T>
4645 inline bool is_equal(const sphere<T>& sphere1, const sphere<T>& sphere2);
4646 
4647 template <typename T>
4648 inline bool not_equal(const T& val1, const T& val2, const T& epsilon);
4649 template <typename T>
4650 inline bool not_equal(const point2d<T>& point1, const point2d<T>& point2,
4651  const T& epsilon);
4652 template <typename T>
4653 inline bool not_equal(const point3d<T>& point1, const point3d<T>& point2,
4654  const T& epsilon);
4655 
4656 template <typename T>
4657 inline bool not_equal(const T& val1, const T& val2);
4658 template <typename T>
4659 inline bool not_equal(const point2d<T>& point1, const point2d<T>& point2);
4660 template <typename T>
4661 inline bool not_equal(const point3d<T>& point1, const point3d<T>& point2);
4662 
4663 template <typename T>
4664 inline bool not_equal(const rectangle<T>& rectangle1,
4665  const rectangle<T>& rectangle2);
4666 template <typename T>
4667 inline bool not_equal(const circle<T>& circle1, const circle<T>& circle2);
4668 
4669 template <typename T>
4670 inline bool not_equal(const box<T, 3>& box1, const box<T, 3>& box2);
4671 template <typename T>
4672 inline bool not_equal(const sphere<T>& sphere1, const sphere<T>& sphere2);
4673 
4674 template <typename T>
4675 inline bool less_than_or_equal(const T& val1, const T& val2, const T& epsilon);
4676 template <typename T>
4677 inline bool less_than_or_equal(const T& val1, const T& val2);
4678 
4679 template <typename T>
4680 inline bool greater_than_or_equal(const T& val1, const T& val2,
4681  const T& epsilon);
4682 template <typename T>
4683 inline bool greater_than_or_equal(const T& val1, const T& val2);
4684 
4685 template <typename T>
4686 inline bool operator<(const point2d<T>& point1, const point2d<T>& point2);
4687 template <typename T>
4688 inline bool operator<(const point3d<T>& point1, const point3d<T>& point2);
4689 template <typename T>
4690 inline bool operator>(const point2d<T>& point1, const point2d<T>& point2);
4691 template <typename T>
4692 inline bool operator>(const point3d<T>& point1, const point3d<T>& point2);
4693 
4694 template <typename T>
4695 inline bool operator==(const point2d<T>& point1, const point2d<T>& point2);
4696 template <typename T>
4697 inline bool operator==(const point3d<T>& point1, const point3d<T>& point2);
4698 
4699 template <typename T>
4700 inline bool is_degenerate(const T& x1, const T& y1, const T& x2, const T& y2);
4701 template <typename T>
4703 template <typename T>
4704 inline bool is_degenerate(const line<T, 2>& line);
4705 
4706 template <typename T>
4707 inline bool is_degenerate(const T& x1, const T& y1, const T& z1, const T& x2,
4708  const T& y2, const T& z2);
4709 template <typename T>
4711 template <typename T>
4712 inline bool is_degenerate(const line<T, 3>& line);
4713 
4714 template <typename T>
4716 template <typename T>
4718 
4719 template <typename T>
4720 inline bool is_degenerate(const quadix<T, 2>& quadix);
4721 template <typename T>
4722 inline bool is_degenerate(const quadix<T, 3>& quadix);
4723 
4724 template <typename T>
4726 template <typename T>
4727 inline bool is_degenerate(const circle<T>& circle);
4728 template <typename T>
4729 inline bool is_degenerate(const sphere<T>& sphere);
4730 template <typename T>
4731 inline bool is_degenerate(const circular_arc<T>& arc);
4732 
4733 template <typename T>
4735 template <typename T>
4737 template <typename T>
4739 template <typename T>
4741 template <typename T>
4743 template <typename T>
4745 template <typename T>
4747 template <typename T>
4749 template <typename T>
4751 template <typename T>
4753 template <typename T>
4755 template <typename T>
4757 template <typename T>
4759 template <typename T>
4761 template <typename T>
4763 template <typename T>
4765 template <typename T>
4767 
4768 template <typename T>
4770 template <typename T>
4772 template <typename T>
4774 template <typename T>
4776 
4777 template <typename T>
4778 inline void swap(point2d<T>& point1, point2d<T>& point2);
4779 template <typename T>
4780 inline void swap(point3d<T>& point1, point3d<T>& point2);
4781 
4782 template <typename T>
4783 inline point2d<T> make_point(const T& x, const T& y);
4784 template <typename T>
4785 inline point3d<T> make_point(const T& x, const T& y, const T& z);
4786 
4787 template <typename T>
4788 inline point2d<T> make_point(const point3d<T> point);
4789 template <typename T>
4790 inline point3d<T> make_point(const point2d<T> point, const T& z = T(0.0));
4791 
4792 template <typename T>
4794 template <typename T>
4796 
4797 template <typename T>
4798 inline vector2d<T> make_vector(const T& x, const T& y);
4799 template <typename T>
4800 inline vector3d<T> make_vector(const T& x, const T& y, const T& z);
4801 
4802 template <typename T>
4804 template <typename T>
4805 inline vector3d<T> make_vector(const vector2d<T> v, const T& z = T(0.0));
4806 
4807 template <typename T>
4808 inline vector2d<T> make_vector(const point2d<T> point);
4809 template <typename T>
4810 inline vector3d<T> make_vector(const point3d<T> point);
4811 
4812 template <typename T>
4813 inline ray<T, 2> make_ray(const T& ox, const T& oy, const T& dir_x,
4814  const T& dir_y);
4815 template <typename T>
4816 inline ray<T, 3> make_ray(const T& ox, const T& oy, const T& oz, const T& dir_x,
4817  const T& dir_y, const T& dir_z);
4818 
4819 template <typename T>
4820 inline ray<T, 2> make_ray(const point2d<T>& origin,
4821  const vector2d<T>& direction);
4822 template <typename T>
4823 inline ray<T, 3> make_ray(const point3d<T>& origin,
4824  const vector3d<T>& direction);
4825 
4826 template <typename T>
4827 inline ray<T, 2> make_ray(const point2d<T>& origin, const T& bearing);
4828 
4829 template <typename T>
4830 inline curve_point<T, 2> make_curve_point(const T& x, const T& y, const T& t);
4831 template <typename T>
4832 inline curve_point<T, 3> make_curve_point(const T& x, const T& y, const T& z,
4833  const T& t);
4834 
4835 template <typename T>
4836 inline curve_point<T, 2> make_curve_point(const point2d<T>& point, const T& t);
4837 template <typename T>
4838 inline curve_point<T, 3> make_curve_point(const point3d<T>& point, const T& t);
4839 
4840 template <typename T>
4841 inline segment<T, 2> make_segment(const T& x1, const T& y1, const T& x2,
4842  const T& y2);
4843 template <typename T>
4844 inline segment<T, 3> make_segment(const T& x1, const T& y1, const T& z1,
4845  const T& x2, const T& y2, const T& z2);
4846 
4847 template <typename T>
4849  const point2d<T>& point2);
4850 template <typename T>
4852  const point3d<T>& point2);
4853 
4854 template <typename T>
4856 template <typename T>
4858 
4859 template <typename T>
4860 inline line<T, 2> make_line(const T& x1, const T& y1, const T& x2, const T& y2);
4861 template <typename T>
4862 inline line<T, 3> make_line(const T& x1, const T& y1, const T& z1, const T& x2,
4863  const T& y2, const T& z2);
4864 
4865 template <typename T>
4866 inline line<T, 2> make_line(const point2d<T>& point1, const point2d<T>& point2);
4867 template <typename T>
4868 inline line<T, 3> make_line(const point3d<T>& point1, const point3d<T>& point2);
4869 
4870 template <typename T>
4872 template <typename T>
4874 
4875 template <typename T>
4877 template <typename T>
4879 
4880 template <typename T>
4881 inline rectangle<T> make_rectangle(const T& x1, const T& y1, const T& x2,
4882  const T& y2);
4883 template <typename T>
4885  const point2d<T>& point2);
4886 
4887 template <typename T>
4888 inline box<T, 3> make_box(const T& x1, const T& y1, const T& z1, const T& x2,
4889  const T& y2, const T& z2);
4890 template <typename T>
4891 inline box<T, 3> make_box(const point3d<T>& point1, const point3d<T>& point2);
4892 
4893 template <typename T>
4894 inline triangle<T, 2> make_triangle(const T& x1, const T& y1, const T& x2,
4895  const T& y2, const T& x3, const T& y3);
4896 
4897 template <typename T>
4898 inline triangle<T, 3> make_triangle(const T& x1, const T& y1, const T& z1,
4899  const T& x2, const T& y2, const T& z2,
4900  const T& x3, const T& y3, const T& z3);
4901 
4902 template <typename T>
4904  const point2d<T>& point2,
4905  const point2d<T>& point3);
4906 template <typename T>
4908  const point3d<T>& point2,
4909  const point3d<T>& point3);
4910 
4911 template <typename T>
4912 inline quadix<T, 2> make_quadix(const T& x1, const T& y1, const T& x2,
4913  const T& y2, const T& x3, const T& y3,
4914  const T& x4, const T& y4);
4915 
4916 template <typename T>
4917 inline quadix<T, 3> make_quadix(const T& x1, const T& y1, const T& z1,
4918  const T& x2, const T& y2, const T& z2,
4919  const T& x3, const T& y3, const T& z3,
4920  const T& x4, const T& y4, const T& z4);
4921 
4922 template <typename T>
4923 inline quadix<T, 2> make_quadix(const point2d<T>& point1,
4924  const point2d<T>& point2,
4925  const point2d<T>& point3,
4926  const point2d<T>& point4);
4927 template <typename T>
4928 inline quadix<T, 3> make_quadix(const point3d<T>& point1,
4929  const point3d<T>& point2,
4930  const point3d<T>& point3,
4931  const point3d<T>& point4);
4932 
4933 template <typename T>
4934 inline quadix<T, 2> make_quadix(const T& x1, const T& y1, const T& x2,
4935  const T& y2);
4936 template <typename T>
4938 
4939 template <typename T>
4940 inline circle<T> make_circle(const T& x, const T& y, const T& radius);
4941 template <typename T>
4942 inline circle<T> make_circle(const point2d<T>& point, const T& radius);
4943 template <typename T>
4944 inline circle<T> make_circle(const point2d<T>& point1,
4945  const point2d<T>& point2);
4946 template <typename T>
4947 inline circle<T> make_circle(const point2d<T>& point1, const point2d<T>& point2,
4948  const point2d<T>& point3);
4949 template <typename T>
4951 
4952 template <typename T>
4953 inline sphere<T> make_sphere(const T& x, const T& y, const T& z,
4954  const T& radius);
4955 template <typename T>
4956 inline sphere<T> make_sphere(const point3d<T>& point, const T& radius);
4957 template <typename T>
4958 inline sphere<T> make_sphere(const point3d<T>& point1,
4959  const point3d<T>& point2);
4960 
4961 template <typename T>
4962 inline plane<T, 3> make_plane(const T& x1, const T& y1, const T& z1,
4963  const T& x2, const T& y2, const T& z2,
4964  const T& x3, const T& y3, const T& z3);
4965 
4966 template <typename T>
4967 inline plane<T, 3> make_plane(const T& px, const T& py, const T& pz,
4968  const T& nx, const T& ny, const T& nz);
4969 
4970 template <typename T>
4971 inline plane<T, 3> make_plane(const point3d<T>& point1,
4972  const point3d<T>& point2,
4973  const point3d<T>& point3);
4974 template <typename T>
4975 inline plane<T, 3> make_plane(const point3d<T>& point,
4976  const vector3d<T>& normal);
4977 template <typename T>
4979 
4980 template <typename T, std::size_t D, typename InputIterator>
4981 inline polygon<T, D> make_polygon(const InputIterator begin,
4982  const InputIterator end);
4983 
4984 template <typename T>
4985 inline polygon<T, 2> make_polygon(const std::vector<point2d<T> >& point_list);
4986 template <typename T>
4987 inline polygon<T, 3> make_polygon(const std::vector<point3d<T> >& point_list);
4988 
4989 template <typename T>
4991 template <typename T>
4993 template <typename T>
4995 template <typename T>
4997  const unsigned int point_count = 360);
4998 
4999 } // namespace wykobi
5000 
5001 #include "wykobi.inl"
5002 
5003 #endif
Definition: wykobi.hpp:702
PointType & reference
Definition: wykobi.hpp:711
const PointType & const_reference
Definition: wykobi.hpp:710
box()
Definition: wykobi.hpp:706
~box()
Definition: wykobi.hpp:707
static const std::size_t PointCount
Definition: wykobi.hpp:704
std::size_t size() const
Definition: wykobi.hpp:721
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:709
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:718
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:717
Definition: wykobi.hpp:426
T y
Definition: wykobi.hpp:428
T x
Definition: wykobi.hpp:428
T radius
Definition: wykobi.hpp:428
Definition: wykobi.hpp:452
T angle1
Definition: wykobi.hpp:458
T px
Definition: wykobi.hpp:457
T y2
Definition: wykobi.hpp:455
T x1
Definition: wykobi.hpp:454
T x2
Definition: wykobi.hpp:455
T cx
Definition: wykobi.hpp:456
T cy
Definition: wykobi.hpp:456
T py
Definition: wykobi.hpp:457
T angle2
Definition: wykobi.hpp:459
T y1
Definition: wykobi.hpp:454
int orientation
Definition: wykobi.hpp:460
Definition: wykobi.hpp:493
~cubic_bezier()
Definition: wykobi.hpp:499
const PointType & const_reference
Definition: wykobi.hpp:502
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:510
std::size_t size() const
Definition: wykobi.hpp:513
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:501
static const BezierType Type
Definition: wykobi.hpp:496
PointType & reference
Definition: wykobi.hpp:503
static const std::size_t PointCount
Definition: wykobi.hpp:495
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:509
cubic_bezier()
Definition: wykobi.hpp:498
Definition: wykobi.hpp:555
~curve_point()
Definition: wykobi.hpp:558
reference operator()()
Definition: wykobi.hpp:569
PointType & reference
Definition: wykobi.hpp:563
const_reference operator()() const
Definition: wykobi.hpp:570
const PointType & const_reference
Definition: wykobi.hpp:562
static const std::size_t PointCount
Definition: wykobi.hpp:560
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:561
std::size_t size() const
Definition: wykobi.hpp:571
T t
Definition: wykobi.hpp:573
curve_point()
Definition: wykobi.hpp:557
cubic_bezier< T, 2 > BezierType
Definition: wykobi.hpp:534
quadratic_bezier< T, 2 > BezierType
Definition: wykobi.hpp:522
cubic_bezier< T, 3 > BezierType
Definition: wykobi.hpp:540
quadratic_bezier< T, 3 > BezierType
Definition: wykobi.hpp:528
Definition: wykobi.hpp:517
point2d< T > PointType
Definition: wykobi.hpp:252
point3d< T > PointType
Definition: wykobi.hpp:258
Definition: wykobi.hpp:244
pointnd< T, Dimension > PointType
Definition: wykobi.hpp:246
vector2d< T > VectorType
Definition: wykobi.hpp:663
vector3d< T > VectorType
Definition: wykobi.hpp:669
Definition: wykobi.hpp:655
vectornd< T, Dimension > VectorType
Definition: wykobi.hpp:657
Definition: wykobi.hpp:47
Definition: wykobi.hpp:440
PointType & reference
Definition: wykobi.hpp:444
PointType center
Definition: wykobi.hpp:446
const PointType & const_reference
Definition: wykobi.hpp:443
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:442
T radius
Definition: wykobi.hpp:447
Definition: wykobi.hpp:287
PointType & reference
Definition: wykobi.hpp:296
const PointType & const_reference
Definition: wykobi.hpp:295
line()
Definition: wykobi.hpp:291
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:294
static const std::size_t PointCount
Definition: wykobi.hpp:289
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:302
~line()
Definition: wykobi.hpp:292
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:303
std::size_t size()
Definition: wykobi.hpp:306
Definition: wykobi.hpp:688
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:693
T constant
Definition: wykobi.hpp:696
VectorType normal
Definition: wykobi.hpp:697
~plane()
Definition: wykobi.hpp:691
define_vector_type< T, Dimension >::VectorType VectorType
Definition: wykobi.hpp:694
plane()
Definition: wykobi.hpp:690
Definition: wykobi.hpp:74
reference operator()(const std::size_t &index)
Definition: wykobi.hpp:90
T x
Definition: wykobi.hpp:104
T type
Definition: wykobi.hpp:76
point2d()
Definition: wykobi.hpp:80
const_reference operator()(const std::size_t &index) const
Definition: wykobi.hpp:93
type & reference
Definition: wykobi.hpp:78
point2d(const pointnd< T, 2 > &point)
Definition: wykobi.hpp:81
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:100
~point2d()
Definition: wykobi.hpp:82
const type & const_reference
Definition: wykobi.hpp:77
T y
Definition: wykobi.hpp:104
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:97
point2d< T > & operator=(const pointnd< T, 2 > &point)
Definition: wykobi.hpp:84
Definition: wykobi.hpp:108
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:130
T z
Definition: wykobi.hpp:135
point3d(const pointnd< T, 3 > &point)
Definition: wykobi.hpp:115
T x
Definition: wykobi.hpp:135
T y
Definition: wykobi.hpp:135
T Type
Definition: wykobi.hpp:110
~point3d()
Definition: wykobi.hpp:116
point3d()
Definition: wykobi.hpp:114
const_reference operator()(const std::size_t &index) const
Definition: wykobi.hpp:126
point3d< T > & operator=(const pointnd< T, 3 > &point)
Definition: wykobi.hpp:118
reference operator()(const std::size_t &index)
Definition: wykobi.hpp:125
Type & reference
Definition: wykobi.hpp:112
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:131
const Type & const_reference
Definition: wykobi.hpp:111
Definition: wykobi.hpp:166
pointnd(const point2d< T > &point)
Definition: wykobi.hpp:192
reference operator()(const std::size_t &index)
Definition: wykobi.hpp:229
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:235
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:234
void clear()
Definition: wykobi.hpp:202
pointnd< T, D > & operator=(const point3d< T > &point)
Definition: wykobi.hpp:220
pointnd(const T &v0)
Definition: wykobi.hpp:172
pointnd(const pointnd< T, D > &point)
Definition: wykobi.hpp:188
pointnd(const T &v0, const T &v1, const T &v2, const T &v3)
Definition: wykobi.hpp:182
pointnd< T, D > & operator=(const point2d< T > &point)
Definition: wykobi.hpp:212
const T & const_reference
Definition: wykobi.hpp:168
pointnd(const T &v0, const T &v1, const T &v2)
Definition: wykobi.hpp:177
const_reference operator()(const std::size_t &index) const
Definition: wykobi.hpp:230
pointnd()
Definition: wykobi.hpp:171
pointnd< T, D > & operator=(const pointnd< T, D > &point)
Definition: wykobi.hpp:206
pointnd(const T &v0, const T &v1)
Definition: wykobi.hpp:173
T & reference
Definition: wykobi.hpp:169
~pointnd()
Definition: wykobi.hpp:200
T v[D]
Definition: wykobi.hpp:240
pointnd(const point3d< T > &point)
Definition: wykobi.hpp:196
Definition: wykobi.hpp:383
void erase(const std::size_t index)
Definition: wykobi.hpp:409
const_iterator begin() const
Definition: wykobi.hpp:413
PointType value_type
Definition: wykobi.hpp:398
void clear() const
Definition: wykobi.hpp:407
void push_back(const PointType &value)
Definition: wykobi.hpp:405
const_iterator end() const
Definition: wykobi.hpp:415
void reserve(const std::size_t amount)
Definition: wykobi.hpp:406
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:401
reference front()
Definition: wykobi.hpp:417
polygon(const std::size_t initial_size=0)
Definition: wykobi.hpp:385
void reverse()
Definition: wykobi.hpp:421
iterator begin()
Definition: wykobi.hpp:414
std::vector< PointType >::iterator iterator
Definition: wykobi.hpp:396
const_reference back() const
Definition: wykobi.hpp:420
const_reference front() const
Definition: wykobi.hpp:418
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:402
const PointType & const_reference
Definition: wykobi.hpp:389
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:388
std::size_t size() const
Definition: wykobi.hpp:412
PointType & reference
Definition: wykobi.hpp:390
std::vector< PointType >::const_iterator const_iterator
Definition: wykobi.hpp:397
~polygon()
Definition: wykobi.hpp:386
void clear()
Definition: wykobi.hpp:408
iterator end()
Definition: wykobi.hpp:416
reference back()
Definition: wykobi.hpp:419
Definition: wykobi.hpp:359
static const std::size_t PointCount
Definition: wykobi.hpp:361
~quadix()
Definition: wykobi.hpp:364
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:366
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:375
const PointType & const_reference
Definition: wykobi.hpp:367
std::size_t size() const
Definition: wykobi.hpp:378
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:374
quadix()
Definition: wykobi.hpp:363
PointType & reference
Definition: wykobi.hpp:368
Definition: wykobi.hpp:468
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:476
~quadratic_bezier()
Definition: wykobi.hpp:474
const PointType & const_reference
Definition: wykobi.hpp:477
std::size_t size() const
Definition: wykobi.hpp:488
PointType & reference
Definition: wykobi.hpp:478
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:484
static const BezierType Type
Definition: wykobi.hpp:471
quadratic_bezier()
Definition: wykobi.hpp:473
static const std::size_t PointCount
Definition: wykobi.hpp:470
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:485
Definition: wykobi.hpp:674
VectorType direction
Definition: wykobi.hpp:683
ray()
Definition: wykobi.hpp:676
define_vector_type< T, Dimension >::VectorType VectorType
Definition: wykobi.hpp:680
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:679
PointType origin
Definition: wykobi.hpp:682
~ray()
Definition: wykobi.hpp:677
Definition: wykobi.hpp:335
static const std::size_t PointCount
Definition: wykobi.hpp:337
const PointType & const_reference
Definition: wykobi.hpp:343
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:350
rectangle()
Definition: wykobi.hpp:339
~rectangle()
Definition: wykobi.hpp:340
PointType & reference
Definition: wykobi.hpp:344
std::size_t size() const
Definition: wykobi.hpp:354
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:351
define_point_type< T, 2 >::PointType PointType
Definition: wykobi.hpp:342
Definition: wykobi.hpp:263
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:278
segment()
Definition: wykobi.hpp:267
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:270
std::size_t size()
Definition: wykobi.hpp:282
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:279
~segment()
Definition: wykobi.hpp:268
PointType & reference
Definition: wykobi.hpp:272
const PointType & const_reference
Definition: wykobi.hpp:271
static const std::size_t PointCount
Definition: wykobi.hpp:265
Definition: wykobi.hpp:433
T z
Definition: wykobi.hpp:435
T y
Definition: wykobi.hpp:435
T radius
Definition: wykobi.hpp:435
T x
Definition: wykobi.hpp:435
Definition: wykobi.hpp:311
std::size_t size() const
Definition: wykobi.hpp:330
const PointType & const_reference
Definition: wykobi.hpp:319
const_reference operator[](const std::size_t &index) const
Definition: wykobi.hpp:327
static const std::size_t PointCount
Definition: wykobi.hpp:313
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:318
PointType & reference
Definition: wykobi.hpp:320
triangle()
Definition: wykobi.hpp:315
reference operator[](const std::size_t &index)
Definition: wykobi.hpp:326
~triangle()
Definition: wykobi.hpp:316
Definition: wykobi.hpp:757
const T & sin(const unsigned int angle) const
Definition: wykobi.hpp:769
static const unsigned int TableSize
Definition: wykobi.hpp:759
trig_luts()
Definition: wykobi.hpp:761
const T & cos(const unsigned int angle) const
Definition: wykobi.hpp:770
const T & tan(const unsigned int angle) const
Definition: wykobi.hpp:771
Definition: wykobi.hpp:582
vector2d(const T &_x=T(0.0), const T &_y=T(0.0))
Definition: wykobi.hpp:584
vector2d< T > & operator=(const vectornd< T, 2 > &vec)
Definition: wykobi.hpp:589
Definition: wykobi.hpp:597
vector3d< T > & operator=(const vectornd< T, 3 > &vec)
Definition: wykobi.hpp:605
vector3d(const T &_x=T(0.0), const T &_y=T(0.0), const T &_z=T(0.0))
Definition: wykobi.hpp:599
Definition: wykobi.hpp:614
vectornd(const T &v0, const T &v1, const T &v2, const T &v3)
Definition: wykobi.hpp:631
vectornd(const vector2d< T > &vec)
Definition: wykobi.hpp:642
vectornd(const T &v0, const T &v1)
Definition: wykobi.hpp:620
vectornd(const T &v0)
Definition: wykobi.hpp:618
vectornd(const vectornd< T, D > &vec)
Definition: wykobi.hpp:638
vectornd()
Definition: wykobi.hpp:616
vectornd(const vector3d< T > &vec)
Definition: wykobi.hpp:647
vectornd(const T &v0, const T &v1, const T &v2)
Definition: wykobi.hpp:625
Definition: wykobi.hpp:32
const int CLIP_BOTTOM
Definition: wykobi.hpp:750
point3d< T > closest_point_on_plane_from_point(const plane< T, 3 > &plane, const point3d< T > &point)
T manhattan_distance(const T &x1, const T &y1, const T &x2, const T &y2)
triangle< T, 2 > create_isosceles_triangle(const point2d< T > &point1, const point2d< T > &point2, const T &angle)
eTriangleType
Definition: wykobi.hpp:726
@ etObtuse
Definition: wykobi.hpp:731
@ etIsosceles
Definition: wykobi.hpp:728
@ etScalene
Definition: wykobi.hpp:730
@ etEquilateral
Definition: wykobi.hpp:727
@ etRight
Definition: wykobi.hpp:729
@ etUnknown
Definition: wykobi.hpp:732
bool quadix_within_box(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &x4, const T &y4, const T &z4, const T &x5, const T &y5, const T &z5, const T &x6, const T &y6, const T &z6)
bool point_on_segment(const point2d< T > &point, const segment< T, 2 > &segment)
int in_sphere(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &x4, const T &y4, const T &z4, const T &px, const T &py, const T &pz)
T vector_norm(const vector2d< T > &v)
bool vertex_is_ear(const std::size_t &index, const polygon< T, 2 > &polygon)
bool cocircular(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &epsilon=T(Epsilon))
T signed_area(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py)
line< Float, 2 > line2d
Definition: wykobi.hpp:781
T lay_distance_from_point_to_circle_center(const point2d< T > &point, const circle< T > &circle)
polygon< T, D > make_polygon(const InputIterator begin, const InputIterator end)
point2d< T > generate_point_on_segment(const segment< T, 2 > &segment, const T &t)
point3d< T > box_corner(const box< T, 3 > &box, const std::size_t &corner_index)
T robust_cartesian_angle(const T &x, const T &y)
triangle< T, 2 > degenerate_triangle2d()
sphere< T > make_sphere(const T &x, const T &y, const T &z, const T &radius)
triangle< T, 2 > bezier_convex_hull(const quadratic_bezier< T, 2 > &bezier)
rectangle< T > degenerate_rectangle()
triangle< T, 2 > create_intouch_triangle(const triangle< T, 2 > &triangle)
bool clip(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, T &cx1, T &cy1, T &cx2, T &cy2)
segment< T, 2 > edge(const triangle< T, 2 > &triangle, const std::size_t &edge_index)
segment< T, 2 > make_segment(const T &x1, const T &y1, const T &x2, const T &y2)
bool segment_within_box(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &x4, const T &y4, const T &z4)
T area(const point2d< T > &point1, const point2d< T > &point2, const point2d< T > &point3)
sphere< T > degenerate_sphere()
bool differing_orientation(const T &x1, const T &y1, const T &x2, const T &y2, const T &p1x, const T &p1y, const T &p2x, const T &p2y)
void circle_tangent_points(const circle< T > &circle, const point2d< T > &point, point2d< T > &point1, point2d< T > &point2)
T distance_from_point_to_sphere_center(const point3d< T > &point, const sphere< T > &sphere)
circle< T > make_circle(const T &x, const T &y, const T &radius)
bool trilateration(const T &c0x, const T &c0y, const T &c0r, const T &c1x, const T &c1y, const T &c1r, const T &c2x, const T &c2y, const T &c2r, T &px, T &py)
line< T, 2 > triangle_median(const triangle< T, 2 > &triangle, const std::size_t &median)
bool point_in_focus_area(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
const int CounterClockwise
Definition: wykobi.hpp:739
line< T, 2 > create_perpendicular_bisector(const T &x1, const T &y1, const T &x2, const T &y2)
bool is_equilateral_triangle(const triangle< T, 2 > &triangle)
bool segment_within_rectangle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
triangle< T, 2 > create_feuerbach_triangle(const triangle< T, 2 > &triangle)
T perpendicular_product(const vector2d< T > &v1, const vector2d< T > &v2)
bool is_isosceles_triangle(const triangle< T, 2 > &triangle)
line< T, 2 > confined_triangle_median(const triangle< T, 2 > &triangle, const point2d< T > &point, const std::size_t &median)
ray< T, 2 > make_ray(const T &ox, const T &oy, const T &dir_x, const T &dir_y)
double epsilon< double >()
Definition: wykobi.hpp:793
triangle< T, 2 > create_outer_napoleon_triangle(const triangle< T, 2 > &triangle)
bool point_in_triangle(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
triangle< T, 2 > create_pedal_triangle(const point2d< T > &point, const triangle< T, 2 > &triangle)
circle< T > invert_circle_across_circle(const circle< T > &circle1, const circle< T > &circle2)
void swap(point2d< T > &point1, point2d< T > &point2)
bool point_in_polygon(const T &px, const T &py, const polygon< T, 2 > &polygon)
void closest_point_on_rectangle_from_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py, T &nx, T &ny)
bool is_point_collinear(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py, const bool robust=false)
void project_point(const T &srcx, const T &srcy, const T &destx, const T &desty, const T &dist, T &nx, T &ny)
bool intersect_vertical_horizontal(const segment< T, 2 > &segment1, const segment< T, 2 > &segment2)
const int CLIP_TOP
Definition: wykobi.hpp:751
T triple_product(const vector3d< T > &v1, const vector3d< T > &v2, const vector3d< T > &v3)
bool parallel(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &epsilon=T(Epsilon))
T epsilon()
bool perpendicular(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &epsilon=T(Epsilon))
bool less_than_or_equal(const T &val1, const T &val2, const T &epsilon)
T horizontal_mirror(const T &angle)
segment< T, 2 > center_at_location(const segment< T, 2 > &segment, const T &x, const T &y)
bool intersect(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
void circle_outer_tangent_segments(const circle< T > &circle0, const circle< T > &circle1, std::vector< segment< T, 2 > > &segments)
ray< T, 2 > degenerate_ray2d()
bool operator<(const point2d< T > &point1, const point2d< T > &point2)
segment< T, 2 > reverse_segment(const segment< T, 2 > &segment)
bool is_equal(const T &val1, const T &val2, const T &epsilon)
triangle< T, 2 > create_circumcevian_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
const int PointInside
Definition: wykobi.hpp:744
circle< T > excircle(const triangle< T, 2 > &triangle, const std::size_t &i)
rectangle< T > aabb(const segment< T, 2 > &segment)
line< T, 2 > triangle_symmedian(const triangle< T, 2 > &triangle, const std::size_t &symmedian)
void closest_point_on_triangle_from_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &px, const T &py, T &nx, T &ny)
bool box_within_box(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &x4, const T &y4, const T &z4)
bool point_on_rectangle(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2)
bool robust_coplanar(const point3d< T > point1, const point3d< T > point2, const point3d< T > point3, const point3d< T > point4, const T &epsilon=T(Epsilon))
bool collinear(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &epsilon=T(Epsilon))
point2d< T > antipodal_point(const point2d< T > &point, const circle< T > &circle)
triangle< T, 2 > create_inner_vecten_triangle(const triangle< T, 2 > &triangle)
bool point_in_quadix(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
T signed_volume(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &px, const T &py, const T &pz)
bool rectangle_to_rectangle_intersect(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
quadix< T, 2 > make_quadix(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
bool triangle_within_rectangle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &x5, const T &y5)
line< T, 2 > degenerate_line2d()
circle< T > inscribed_circle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
void project_point135(const T &px, const T &py, const T &distance, T &nx, T &ny)
circle< T > mandart_circle(const triangle< T, 2 > &triangle)
void lengthen_segment(T &x1, T &y1, T &x2, T &y2, const T &amount)
point2d< T > negative_infinite_point2d()
line< T, 3 > degenerate_line3d()
vector3d< T > degenerate_vector3d()
T lay_distance_segment_to_segment(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
sphere< T > invert_sphere_across_sphere(const sphere< T > &sphere1, const sphere< T > &sphere2)
bool point_in_three_point_circle(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
const int CLIP_LEFT
Definition: wykobi.hpp:752
void create_equilateral_quadix(const T &x1, const T &y1, const T &x2, const T &y2, T &x3, T &y3, T &x4, T &y4)
bool circle_within_rectangle(const T &x, const T &y, const T &radius, const T &x1, const T &y1, const T &x2, const T &y2)
void generate_random_object(const T &x1, const T &y1, const T &x2, const T &y2, segment< T, 2 > &segment)
bool robust_parallel(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &epsilon=T(Epsilon))
bool point_in_convex_polygon(const T &px, const T &py, const polygon< T, 2 > &polygon)
bool is_right_triangle(const wykobi::triangle< T, 2 > &triangle)
T bezier_curve_length(const quadratic_bezier< T, 2 > &bezier, const std::size_t &point_count)
point3d< T > closest_point_on_sphere_from_point(const sphere< T > &sphere, const point3d< T > &point)
bool point_of_reflection(const T &sx1, const T &sy1, const T &sx2, const T &sy2, const T &p1x, const T &p1y, const T &p2x, const T &p2y, T &rpx, T &rpy)
void closest_point_on_quadix_from_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &px, const T &py, T &nx, T &ny)
int polygon_orientation(const polygon< T, 2 > &polygon)
void centroid(const T &x1, const T &y1, const T &x2, const T &y2, T &x, T &y)
const int Cocircular
Definition: wykobi.hpp:746
bool box_to_box_intersect(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &x4, const T &y4, const T &z4)
bool coplanar(const ray< T, 3 > &ray1, const ray< T, 3 > &ray2)
void order_sensitive_closest_point_on_line_from_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py, T &nx, T &ny)
const int AboveOrientation
Definition: wykobi.hpp:741
triangle< T, 2 > create_anticomplementary_triangle(const triangle< T, 2 > &triangle)
circle< T > circumcircle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
T vertex_angle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
T sin(const T &value)
Definition: wykobi_math.hpp:138
segment< T, 2 > degenerate_segment2d()
T perimeter(const point2d< T > &point1, const point2d< T > &point2, const point2d< T > &point3)
const int BelowOrientation
Definition: wykobi.hpp:742
float epsilon< float >()
Definition: wykobi.hpp:797
T lay_distance_line_to_line(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
void project_point_t(const T &srcx, const T &srcy, const T &destx, const T &desty, const T &t, T &nx, T &ny)
const int RightHandSide
Definition: wykobi.hpp:736
vector2d< T > operator+(const vector2d< T > &v1, const vector2d< T > &v2)
T minimum_distance_from_point_to_segment(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2)
void project_point45(const T &px, const T &py, const T &distance, T &nx, T &ny)
bool operator>(const point2d< T > &point1, const point2d< T > &point2)
T vertical_mirror(const T &angle)
bool is_convex_polygon(const polygon< T, 2 > &polygon)
triangle< T, 2 > create_contact_triangle(const triangle< T, 2 > &triangle)
void circle_outer_tangent_lines(const circle< T > &circle0, const circle< T > &circle1, std::vector< line< T, 2 > > &lines)
T cos(const T &value)
Definition: wykobi_math.hpp:143
void closest_point_on_line_from_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py, T &nx, T &ny)
T tan(const T &value)
Definition: wykobi_math.hpp:148
line< T, 2 > create_line_from_bisector(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
void generate_bezier(const quadratic_bezier< T, 2 > &bezier, OutputIterator out, const std::size_t &point_count=1000)
void closest_point_on_box_from_point(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &px, const T &py, const T &pz, T &nx, T &ny, T &nz)
point2d< T > closest_point_on_circle_from_segment(const circle< T > &circle, const segment< T, 2 > &segment)
bool intersect_vertical_vertical(const segment< T, 2 > &segment1, const segment< T, 2 > &segment2)
void circle_internal_tangent_segments(const circle< T > &circle0, const circle< T > &circle1, std::vector< segment< T, 2 > > &segments)
bool simplex_to_bezier_intersect(const Simplex &simplex, const Bezier &bezier, const std::size_t &steps)
bool robust_collinear(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &epsilon=T(Epsilon))
T lay_distance_from_point_to_sphere_center(const point3d< T > &point, const sphere< T > &sphere)
const int Cospherical
Definition: wykobi.hpp:747
point2d< T > isogonal_conjugate(const point2d< T > &point, const triangle< T, 2 > &triangle)
vector2d< T > degenerate_vector2d()
segment< T, 3 > degenerate_segment3d()
const int PointOutside
Definition: wykobi.hpp:745
void segment_mid_point(const T &x1, const T &y1, const T &x2, const T &y2, T &midx, T &midy)
triangle< T, 2 > create_morley_triangle(const triangle< T, 2 > &triangle)
point3d< T > positive_infinite_point3d()
ray< T, 2 > create_ray_from_bisector(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
void closest_point_on_segment_from_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py, T &nx, T &ny)
point2d< T > exmedian_point(const triangle< T, 2 > &triangle, const std::size_t &corner)
bool point_on_quadix(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
void project_point90(const T &px, const T &py, const T &distance, T &nx, T &ny)
bool line_to_line_intersect(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
bool point_in_rectangle(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2)
segment< Float, 3 > segment3d
Definition: wykobi.hpp:785
line< T, 2 > euler_line(const triangle< T, 2 > &triangle)
unsigned int quadrant(const T &angle)
bool not_equal(const T &val1, const T &val2, const T &epsilon)
box< T, 3 > make_box(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2)
segment< T, 2 > create_segment_from_bisector(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
sphere< T > inscribed_sphere(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3)
line< T, 2 > perspectrix(const triangle< T, 2 > &triangle1, const triangle< T, 2 > &triangle2)
T chebyshev_distance(const T &x1, const T &y1, const T &x2, const T &y2)
int orientation(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py)
T oriented_vertex_angle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const int orient=Clockwise)
line< T, 2 > triangle_bisector(const triangle< T, 2 > &triangle, const std::size_t &bisector)
T generate_random_value(const T &range)
bool is_skinny_triangle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
triangle< Float, 3 > triangle3d
Definition: wykobi.hpp:787
void project_point315(const T &px, const T &py, const T &distance, T &nx, T &ny)
point2d< T > rectangle_corner(const rectangle< T > &rectangle, const std::size_t &corner_index)
void incenter(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, T &px, T &py)
point2d< T > degenerate_point2d()
T normalize_angle(const T &angle)
point2d< T > generate_random_point(const T &dx, const T &dy)
triangle< T, 2 > create_circummedial_triangle(const triangle< T, 2 > &triangle)
bool point_on_ray(const T &px, const T &py, const T &ox, const T &oy, const T &dx, const T &dy)
void project_point0(const T &px, const T &py, const T &distance, T &nx, T &ny)
triangle< T, 2 > create_orthic_triangle(const triangle< T, 2 > &triangle)
bool point_in_sphere(const T &px, const T &py, const T &pz, const T &cx, const T &cy, const T &cz, const T &radius)
bool robust_perpendicular(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &epsilon=T(Epsilon))
bool point_on_triangle(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
void intersection_point_line_to_line(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &x4, const T &y4, const T &z4, T &Ix, T &Iy, T &Iz, const T &fuzzy=T(0.0))
point2d< T > generate_point_on_ray(const ray< T, 2 > &ray, const T &t)
triangle< T, 2 > create_extouch_triangle(const triangle< T, 2 > &triangle)
circle< T > nine_point_circle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
T lay_distance(const T &x1, const T &y1, const T &x2, const T &y2)
point2d< T > closest_point_on_circle_from_point(const circle< T > &circle, const point2d< T > &point)
const int LeftHandSide
Definition: wykobi.hpp:737
bool common_center(const circle< T > &circle1, const circle< T > &circle2)
void shorten_segment(T &x1, T &y1, T &x2, T &y2, const T &amount)
triangle< T, 2 > create_cevian_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
void intersection_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, T &ix, T &iy)
T cartesian_angle(const T &x, const T &y)
circle< T > update_circle(const circle< T > &circle, point2d< T > &point)
point2d< T > feuerbach_point(const triangle< T, 2 > &triangle)
point2d< T > make_point(const T &x, const T &y)
box< T, 3 > update_box(const box< T, 3 > &box, point3d< T > &point)
bool triangle_within_box(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3, const T &x4, const T &y4, const T &z4, const T &x5, const T &y5, const T &z5)
circle< T > brocard_circle(const triangle< T, 2 > &triangle)
void generate_random_points(const T &x1, const T &y1, const T &x2, const T &y2, const std::size_t &point_count, OutputIterator out)
bool are_perspective_triangles(const triangle< T, 2 > &triangle1, const triangle< T, 2 > &triangle2)
bool simple_intersect(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
T minimum_distance_from_point_to_triangle(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
T operator*(const vector2d< T > &v1, const vector2d< T > &v2)
triangle< T, 2 > create_medial_triangle(const triangle< T, 2 > &triangle)
triangle< T, 2 > make_triangle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
bool convex_vertex(const std::size_t &index, const polygon< T, 2 > &polygon, const int &polygon_orientation=LeftHandSide)
segment< T, 2 > project_onto_axis(const point2d< T > &point, const line< T, 2 > &axis)
triangle< T, 2 > create_symmedial_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
sphere< T > circumsphere(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3)
point2d< T > excenter(const triangle< T, 2 > &triangle, const std::size_t &corner)
point2d< T > closest_point_on_polygon_from_point(const polygon< T, 2 > &polygon, const point2d< T > &point)
void calculate_bezier_coefficients(const quadratic_bezier< T, 2 > &bezier, T &ax, T &bx, T &ay, T &by)
void project_point225(const T &px, const T &py, const T &distance, T &nx, T &ny)
void circumcenter(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, T &px, T &py)
segment< T, 2 > opposing_edge(const triangle< T, 2 > &triangle, const std::size_t &corner)
bool convex_quadix(const quadix< T, 2 > &quadix)
point2d< T > invert_point(const point2d< T > &point, const circle< T > &circle)
bool operator==(const point2d< T > &point1, const point2d< T > &point2)
void fast_rotate(const trig_luts< T > &lut, const int rotation_angle, const T &x, const T &y, T &nx, T &ny)
triangle< Float, 2 > triangle2d
Definition: wykobi.hpp:782
point3d< T > negative_infinite_point3d()
point3d< T > closest_point_on_sphere_from_sphere(const sphere< T > &sphere1, const sphere< T > &sphere2)
vector2d< T > operator/(const vector2d< T > &v1, const T &scale)
T minimum_distance_from_point_to_rectangle(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2)
void mirror(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, T &nx, T &ny)
rectangle< T > make_rectangle(const T &x1, const T &y1, const T &x2, const T &y2)
quadix< Float, 2 > quadix2d
Definition: wykobi.hpp:783
vector2d< T > operator-(const vector2d< T > &v1, const vector2d< T > &v2)
T distance_from_point_to_circle_center(const point2d< T > &point, const circle< T > &circle)
line< T, 2 > create_perpendicular_line_at_end_point(const line< T, 2 > &line)
bool is_tangent(const segment< T, 2 > &segment, const circle< T > &circle)
BezierType
Definition: wykobi.hpp:464
@ eQuadraticBezier
Definition: wykobi.hpp:464
@ eCubicBezier
Definition: wykobi.hpp:464
triangle< T, 2 > right_shift(const triangle< T, 2 > &triangle, const std::size_t &shift)
triangle< T, 2 > create_outer_vecten_triangle(const triangle< T, 2 > &triangle)
void create_right_triangle(const wykobi::point2d< T > &p1, const wykobi::point2d< T > &p2, wykobi::point2d< T > &c1, wykobi::point2d< T > &c2)
void closest_point_on_ray_from_point(const T &ox, const T &oy, const T &dx, const T &dy, const T &px, const T &py, T &nx, T &ny)
triangle< T, 3 > degenerate_triangle3d()
curve_point< T, 2 > make_curve_point(const T &x, const T &y, const T &t)
point2d< T > minkowski_sum(const point2d< T > &point1, const point2d< T > &point2)
rectangle< T > update_rectangle(const rectangle< T > &rectangle, point2d< T > &point)
line< Float, 3 > line3d
Definition: wykobi.hpp:786
T dot_product(const vector2d< T > &v1, const vector2d< T > &v2)
T span_length(const rectangle< T > &rectangle)
ray< T, 3 > degenerate_ray3d()
circle< T > degenerate_circle()
quadix< Float, 3 > quadix3d
Definition: wykobi.hpp:788
point2d< T > symmedian_point(const triangle< T, 2 > &triangle)
void project_point180(const T &px, const T &py, const T &distance, T &nx, T &ny)
bool point_on_circle(const T &px, const T &py, const T &cx, const T &cy, const T &radius)
point3d< T > closest_point_on_sphere_from_segment(const sphere< T > &sphere, const segment< T, 3 > &segment)
triangle< T, 2 > create_inner_napoleon_triangle(const triangle< T, 2 > &triangle)
const int Clockwise
Definition: wykobi.hpp:738
bool intersect_horizontal_horizontal(const segment< T, 2 > &segment1, const segment< T, 2 > &segment2)
quadix< T, 2 > degenerate_quadix2d()
vector2d< T > make_vector(const T &x, const T &y)
T minimum_distance_from_point_to_line(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2)
triangle< T, 2 > vertex_triangle(const std::size_t &index, const polygon< T, 2 > polygon)
bool point_in_polygon_winding_number(const T &px, const T &py, const polygon< T, 2 > &polygon)
bool collinear_vertex(const std::size_t &index, const polygon< T, 2 > &polygon)
triangle< T, 2 > create_triangle(const point2d< T > &point1, const point2d< T > &point2, const T &angle1, const T &angle2)
triangle< T, 2 > create_excentral_triangle(const triangle< T, 2 > &triangle)
T distance_segment_to_segment(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
void circle_internal_tangent_lines(const circle< T > &circle0, const circle< T > &circle1, std::vector< line< T, 2 > > &lines)
triangle< T, 2 > create_anticevian_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
bool point_in_box(const T &px, const T &py, const T &pz, const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2)
triangle< T, 2 > create_incentral_triangle(const triangle< T, 2 > &triangle)
T distance_line_to_line(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
line< T, 2 > triangle_external_bisector(const triangle< T, 2 > &triangle, const std::size_t &corner, const std::size_t &opposing_corner)
line< T, 2 > create_parallel_line_on_point(const line< T, 2 > &line, const point2d< T > &point)
triangle< T, 2 > create_first_brocard_triangle(const triangle< T, 2 > &triangle)
line< T, 2 > tangent_line(const circle< T > &circle, const point2d< T > &point)
point2d< T > scale(const T &dx, const T &dy, const point2d< T > &point)
void create_equilateral_triangle(const T &x1, const T &y1, const T &x2, const T &y2, T &x3, T &y3)
plane< T, 3 > make_plane(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2, const T &x3, const T &y3, const T &z3)
point2d< T > closest_point_on_bezier_from_point(const quadratic_bezier< T, 2 > &bezier, const point2d< T > &point, const std::size_t &steps=1000)
quadix< T, 3 > degenerate_quadix3d()
bool circle_in_circle(const circle< T > &circle1, const circle< T > &circle2)
bool quadix_within_rectangle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4, const T &x5, const T &y5, const T &x6, const T &y6)
int in_circle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &px, const T &py)
point2d< T > minkowski_difference(const point2d< T > &point1, const point2d< T > &point2)
bool greater_than_or_equal(const T &val1, const T &val2, const T &epsilon)
void project_point270(const T &px, const T &py, const T &distance, T &nx, T &ny)
bool is_degenerate(const T &x1, const T &y1, const T &x2, const T &y2)
T inverse_chebyshev_distance(const T &x1, const T &y1, const T &x2, const T &y2)
point2d< T > project_object(const point2d< T > &point, const T &angle, const T &distance)
const int CoplanarOrientation
Definition: wykobi.hpp:743
sphere< T > update_sphere(const sphere< T > &sphere, point3d< T > &point)
line< T, 2 > make_line(const T &x1, const T &y1, const T &x2, const T &y2)
segment< Float, 2 > segment2d
Definition: wykobi.hpp:780
bool point_in_circle(const T &px, const T &py, const T &cx, const T &cy, const T &radius)
bool polygon_within_box(const polygon< T, 3 > &polygon, const box< T, 3 > &box)
void nonsymmetric_mirror(const T &px, const T &py, const T &x1, const T &y1, const T &x2, const T &y2, const T &ratio, T &nx, T &ny)
int out_code(const point2d< T > &point, const rectangle< T > &rectangle)
vector2d< T > normalize(const vector2d< T > &v)
const int CollinearOrientation
Definition: wykobi.hpp:740
T distance(const T &x1, const T &y1, const T &x2, const T &y2)
segment< T, 2 > create_parallel_segment_on_point(const line< T, 2 > &line, const point2d< T > &point)
void torricelli_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, T &px, T &py)
eInclusion
Definition: wykobi.hpp:724
@ eUnknown
Definition: wykobi.hpp:724
@ ePartially
Definition: wykobi.hpp:724
@ eFully
Definition: wykobi.hpp:724
@ eOutside
Definition: wykobi.hpp:724
point2d< T > create_point_on_bezier(const point2d< T > &start_point, const T &ax, const T &bx, const T &ay, const T &by, const T &t)
bool point_on_bezier(const point2d< T > &point, const quadratic_bezier< T, 2 > &bezier, const std::size_t &steps=1000, const T &fuzzy=T(Epsilon))
void order_sensitive_closest_point_on_segment_from_point(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py, T &nx, T &ny)
geometric_type
Definition: wykobi.hpp:49
@ ePoint2D
Definition: wykobi.hpp:50
@ eTriangle2D
Definition: wykobi.hpp:58
@ eSegment2D
Definition: wykobi.hpp:52
@ eTriangle3D
Definition: wykobi.hpp:59
@ eLine3D
Definition: wykobi.hpp:57
@ eQuadix3D
Definition: wykobi.hpp:61
@ ePoint3D
Definition: wykobi.hpp:51
@ eSphere
Definition: wykobi.hpp:65
@ eLine2D
Definition: wykobi.hpp:56
@ eSegment3D
Definition: wykobi.hpp:53
@ eCircle
Definition: wykobi.hpp:64
@ eQuadix2D
Definition: wykobi.hpp:60
@ eRay2D
Definition: wykobi.hpp:62
@ eRectangle
Definition: wykobi.hpp:54
@ eRay3D
Definition: wykobi.hpp:63
@ eBox
Definition: wykobi.hpp:55
point2d< T > positive_infinite_point2d()
point2d< T > cyclocevian_conjugate(const point2d< T > &point, const triangle< T, 2 > &triangle)
bool sphere_within_box(const T &x, const T &y, const T &z, const T &radius, const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2)
bool rectangle_within_rectangle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, const T &x4, const T &y4)
void rotate(const T &rotation_angle, const T &x, const T &y, T &nx, T &ny)
bool polygon_within_rectangle(const polygon< T, 2 > &polygon, const rectangle< T > &rectangle)
const int CLIP_RIGHT
Definition: wykobi.hpp:753
point3d< T > degenerate_point3d()
triangle< T, 2 > create_antipedal_triangle(const point2d< T > &point, const triangle< T, 2 > &triangle)
int robust_orientation(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py)
bool point_on_polygon_edge(const T &px, const T &py, const polygon< T, 2 > &polygon)
point2d< T > orthocenter(const triangle< T, 2 > &triangle)
point2d< T > translate(const T &dx, const T &dy, const point2d< T > &point)
polygon< T, 2 > remove_consecutive_collinear_points(const polygon< T, 2 > &polygon)
point2d< T > closest_point_on_circle_from_circle(const circle< T > &circle1, const circle< T > &circle2)
point2d< T > closest_point_on_aabbb_from_point(const rectangle< T > &rectangle, const point2d< T > &point)
Definition: wykobi.hpp:545
PointType & reference
Definition: wykobi.hpp:548
const PointType & const_reference
Definition: wykobi.hpp:547
define_point_type< T, Dimension >::PointType PointType
Definition: wykobi.hpp:546
PointType value[Type]
Definition: wykobi.hpp:550