biped-stabilizer 1.5.0
Stabilizer for Biped Locomotion
Loading...
Searching...
No Matches
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
32namespace wykobi {
33
34static const char VERSION_INFORMATION[] = "Wykobi Version 0.0.5";
35static const char AUTHOR_INFORMATION[] = "Arash Partow";
36static 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
67
68/**************[ Vertex type ]***************/
69
70template <typename T, std::size_t D>
71class pointnd;
72
73template <typename T = Float>
74class 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]) {}
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
107template <typename T = Float>
108class 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]) {}
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
165template <typename T, std::size_t D>
166class 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
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
243template <typename T, std::size_t Dimension>
248
249template <typename T>
250class define_point_type<T, 2> {
251 public:
253};
254
255template <typename T>
256class define_point_type<T, 3> {
257 public:
259};
260
261/************[ Segment Type ]************/
262template <typename T, std::size_t Dimension>
263class segment : public geometric_entity {
264 public:
265 const static std::size_t PointCount = 2;
266
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 ]************/
286template <typename T, std::size_t Dimension>
287class 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 ]************/
310template <typename T, std::size_t Dimension>
311class triangle : public geometric_entity {
312 public:
313 const static std::size_t PointCount = 3;
314
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 ]************/
334template <typename T>
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 ]************/
358template <typename T, std::size_t Dimension>
359class quadix : public geometric_entity {
360 public:
361 const static std::size_t PointCount = 4;
362
363 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 ]************/
382template <typename T, std::size_t Dimension>
383class polygon : public geometric_entity {
384 public:
385 polygon(const std::size_t initial_size = 0) : _data(initial_size) {}
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 ]************/
425template <typename T>
426class circle : public geometric_entity {
427 public:
428 T x, y, radius;
429};
430
431/************[ Sphere Type ]************/
432template <typename T>
433class sphere : public geometric_entity {
434 public:
435 T x, y, z, radius;
436};
437
438/************[ Hypersphere Type ]************/
439template <typename T, std::size_t Dimension>
449
450/************[ CircularArc Type ]**************/
451template <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 ]************/
467template <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 ]************/
492template <typename T, std::size_t Dimension>
494 public:
495 const static std::size_t PointCount = 4;
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
516template <typename T, unsigned int Dimension, BezierType BType>
518
519template <typename T>
524
525template <typename T>
530
531template <typename T>
533 public:
535};
536
537template <typename T>
539 public:
541};
542
543/************[ Bezier Coefficients ]************/
544template <typename T, unsigned int Dimension, BezierType Type>
552
553/************[ Curve Point Type ]************/
554template <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
578template <typename T, std::size_t D>
579class vectornd;
580
581template <typename T>
582class 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
596template <typename T>
597class 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
613template <typename T, std::size_t D>
614class 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
654template <typename T, std::size_t Dimension>
659
660template <typename T>
661class define_vector_type<T, 2> {
662 public:
664};
665
666template <typename T>
667class define_vector_type<T, 3> {
668 public:
670};
671
672/************[ Ray Type ]************/
673template <typename T, std::size_t Dimension>
685
686/************[ Plane Type ]************/
687template <typename T, std::size_t Dimension>
699
700/************[ Box Type ]************/
701template <typename T, std::size_t Dimension>
702class 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
734
735/**********[ Orientation constants ]**********/
736const int RightHandSide = -1;
737const int LeftHandSide = +1;
738const int Clockwise = -1;
739const int CounterClockwise = +1;
741const int AboveOrientation = +1;
742const int BelowOrientation = -1;
743const int CoplanarOrientation = 0;
744const int PointInside = +1;
745const int PointOutside = -1;
746const int Cocircular = 0;
747const int Cospherical = 0;
748
749/********[ Clipping Codes ]********/
750const int CLIP_BOTTOM = 1;
751const int CLIP_TOP = 2;
752const int CLIP_LEFT = 4;
753const int CLIP_RIGHT = 8;
754
755/************[ Trigonometry Tables ]************/
756template <typename T>
757class 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
790template <typename T>
792template <>
793inline double epsilon<double>() {
794 return static_cast<double>(Epsilon_Medium);
795}
796template <>
797inline float epsilon<float>() {
798 return static_cast<float>(Epsilon_Low);
799}
800
801template <typename T>
802inline int orientation(const T& x1, const T& y1, const T& x2, const T& y2,
803 const T& px, const T& py);
804
805template <typename T>
806inline 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
810template <typename T>
811inline int robust_orientation(const T& x1, const T& y1, const T& x2,
812 const T& y2, const T& px, const T& py);
813
814template <typename T>
815inline 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
820template <typename T>
821inline int orientation(const point2d<T>& point1, const point2d<T>& point2,
822 const T& px, const T& py);
823
824template <typename T>
825inline int orientation(const point2d<T>& point1, const point2d<T>& point2,
826 const point2d<T>& point3);
827
828template <typename T>
829inline int orientation(const line<T, 2>& line, const point2d<T>& point);
830
831template <typename T>
832inline int orientation(const segment<T, 2>& segment, const point2d<T>& point);
833
834template <typename T>
836
837template <typename T>
838inline 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
842template <typename T>
843inline int orientation(const point3d<T>& point1, const point3d<T>& point2,
844 const point3d<T>& point3, const point3d<T>& point4);
845
846template <typename T>
847inline int orientation(const triangle<T, 3>& triangle, const point3d<T>& point);
848
849template <typename T>
850inline 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
854template <typename T>
855inline bool differing_orientation(const point2d<T>& p1, const point2d<T>& p2,
856 const point2d<T>& q1, const point2d<T>& q2);
857
858template <typename T>
859inline 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
862template <typename T>
863inline int in_circle(const point2d<T>& point1, const point2d<T>& point2,
864 const point2d<T>& point3, const point2d<T>& point4);
865
866template <typename T>
867inline int in_circle(const triangle<T, 2>& triangle, const point2d<T>& point);
868
869template <typename T>
870inline 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
875template <typename T>
876inline 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
880template <typename T>
881inline int in_sphere(const quadix<T, 3>& quadix, const point3d<T>& point);
882
883template <typename T>
884inline T signed_area(const T& x1, const T& y1, const T& x2, const T& y2,
885 const T& px, const T& py);
886
887template <typename T>
888inline T signed_area(const point2d<T>& point1, const point2d<T>& point2,
889 const T& px, const T& py);
890
891template <typename T>
892inline T signed_area(const point2d<T>& point1, const point2d<T>& point2,
893 const point2d<T>& point3);
894
895template <typename T>
896inline T signed_area(const segment<T, 2>& segment, const point2d<T>& point);
897
898template <typename T>
899inline 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
903template <typename T>
904inline 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
908template <typename T>
909inline T signed_volume(const point3d<T>& point1, const point3d<T>& point2,
910 const point3d<T>& point3, const point3d<T>& point4);
911
912template <typename T>
913inline T signed_volume(const triangle<T, 3>& triangle, const point3d<T>& point);
914
915template <typename T>
916inline 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
919template <typename T>
920inline 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
924template <typename T>
925inline bool collinear(const point2d<T>& point1, const point2d<T>& point2,
926 const point2d<T>& point3);
927
928template <typename T>
929inline bool collinear(const point3d<T>& point1, const point3d<T>& point2,
930 const point3d<T>& point3);
931
932template <typename T>
933inline 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));
936template <typename T>
937inline bool robust_collinear(const point2d<T>& point1, const point2d<T>& point2,
938 const point2d<T>& point3,
939 const T& epsilon = T(Epsilon));
940
941template <typename T>
942inline bool robust_collinear(const line<T, 2>& line, const point2d<T>& point,
943 const T& epsilon = T(Epsilon));
944
945template <typename T>
946inline bool robust_collinear(const line<T, 3>& line, const point3d<T>& point,
947 const T& epsilon = T(Epsilon));
948
949template <typename T>
950inline 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));
953template <typename T>
954inline bool robust_collinear(const point3d<T>& point1, const point3d<T>& point2,
955 const point3d<T>& point3,
956 const T& epsilon = T(Epsilon));
957
958template <typename T>
959inline 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);
962template <typename T>
963inline bool is_point_collinear(const point2d<T>& point1,
964 const point2d<T>& point2,
965 const point2d<T>& point3,
966 const bool robust = false);
967
968template <typename T>
969inline bool is_point_collinear(const point2d<T>& point1,
970 const point2d<T>& point2, const T& px,
971 const T& py, const bool robust = false);
972template <typename T>
974 const point2d<T>& point,
975 const bool robust = false);
976
977template <typename T>
978inline 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
983template <typename T>
984inline bool is_point_collinear(const point3d<T>& point1,
985 const point3d<T>& point2,
986 const point3d<T>& point3,
987 const bool robust = false);
988
989template <typename T>
991 const point3d<T>& point,
992 const bool robust = false);
993
994template <typename T>
995inline 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
999template <typename T>
1000inline bool coplanar(const ray<T, 3>& ray1, const ray<T, 3>& ray2);
1001template <typename T>
1002inline bool coplanar(const segment<T, 3>& segment1,
1003 const segment<T, 3>& segment2);
1004template <typename T>
1005inline bool coplanar(const line<T, 3>& line1, const line<T, 3>& line2);
1006template <typename T>
1007inline bool coplanar(const triangle<T, 3>& triangle1,
1008 const triangle<T, 3>& triangle2);
1009template <typename T>
1010inline bool coplanar(const quadix<T, 3>& quadix1, const quadix<T, 3>& quadix2);
1011
1012template <typename T>
1013inline 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
1017template <typename T>
1018inline 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
1022template <typename T>
1023inline bool cocircular(const triangle<T, 2>& triangle, const point2d<T>& point,
1024 const T& epsilon = T(Epsilon));
1025
1026template <typename T>
1027inline bool cocircular(const circle<T>& circle, const point2d<T>& point,
1028 const T& epsilon = T(Epsilon));
1029
1030template <typename T>
1031inline bool is_skinny_triangle(const T& x1, const T& y1, const T& x2,
1032 const T& y2, const T& x3, const T& y3);
1033
1034template <typename T>
1035inline bool is_skinny_triangle(const point2d<T>& point1,
1036 const point2d<T>& point2,
1037 const point2d<T>& point3);
1038
1039template <typename T>
1041
1042template <typename T>
1043inline 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
1046template <typename T>
1047inline 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);
1050template <typename T>
1051inline bool intersect(const point2d<T>& point1, const point2d<T>& point2,
1052 const point2d<T>& point3, const point2d<T>& point4);
1053
1054template <typename T>
1055inline 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
1059template <typename T>
1060inline bool intersect(const segment<T, 2>& segment1,
1061 const segment<T, 2>& segment2);
1062
1063template <typename T>
1064inline bool intersect(const segment<T, 2>& segment1,
1065 const segment<T, 2>& segment2, T& ix, T& iy);
1066
1067template <typename T>
1068inline bool intersect(const segment<T, 2>& segment1,
1069 const segment<T, 2>& segment2, point2d<T>& i_point);
1070
1071template <typename T>
1072inline 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
1077template <typename T>
1078inline 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
1082template <typename T>
1083inline bool intersect(const segment<T, 3>& segment1,
1084 const segment<T, 3>& segment2, const T& fuzzy = T(0.0));
1085template <typename T>
1086inline bool intersect(const segment<T, 2>& segment,
1087 const rectangle<T>& rectangle);
1088template <typename T>
1089inline bool intersect(const segment<T, 2>& segment,
1090 const triangle<T, 2>& triangle);
1091template <typename T>
1093template <typename T>
1094inline bool intersect(const segment<T, 2>& segment, const line<T, 2>& line);
1095template <typename T>
1096inline bool intersect(const segment<T, 2>& segment, const circle<T>& circle);
1097template <typename T>
1098inline bool intersect(const segment<T, 2>& segment,
1099 const quadratic_bezier<T, 2>& bezier,
1100 const std::size_t& steps = 1000);
1101template <typename T>
1102inline bool intersect(const segment<T, 2>& segment,
1103 const cubic_bezier<T, 2>& bezier,
1104 const std::size_t& steps = 1000);
1105template <typename T>
1106inline bool intersect(const segment<T, 3>& segment, const line<T, 3>& line,
1107 const T& fuzzy = T(0.0));
1108template <typename T>
1109inline bool intersect(const segment<T, 3>& segment, const box<T, 3>& box);
1110template <typename T>
1111inline bool intersect(const segment<T, 3>& segment, const sphere<T>& sphere);
1112template <typename T>
1113inline bool intersect(const segment<T, 3>& segment, const plane<T, 3>& plane);
1114template <typename T>
1115inline bool intersect(const segment<T, 3>& segment,
1116 const quadratic_bezier<T, 3>& bezier,
1117 const std::size_t& steps = 1000);
1118template <typename T>
1119inline bool intersect(const segment<T, 3>& segment,
1120 const cubic_bezier<T, 3>& bezier,
1121 const std::size_t& steps = 1000);
1122template <typename T>
1123inline bool intersect(const line<T, 2>& line, const triangle<T, 2>& triangle);
1124template <typename T>
1125inline bool intersect(const line<T, 2>& line, const quadix<T, 2>& quadix);
1126template <typename T>
1127inline bool intersect(const line<T, 2>& line1, const line<T, 2>& line2);
1128template <typename T>
1129inline bool intersect(const line<T, 2>& line, const circle<T>& circle);
1130template <typename T>
1131inline bool intersect(const line<T, 2>& line,
1132 const quadratic_bezier<T, 2>& bezier,
1133 const std::size_t& steps = 1000);
1134template <typename T>
1135inline bool intersect(const line<T, 2>& line, const cubic_bezier<T, 2>& bezier,
1136 const std::size_t& steps = 1000);
1137template <typename T>
1138inline bool intersect(const line<T, 3>& line, const triangle<T, 3>& triangle);
1139template <typename T>
1140inline bool intersect(const line<T, 3>& line, const plane<T, 3>& plane);
1141template <typename T>
1142inline bool intersect(const line<T, 3>& line, const sphere<T>& sphere);
1143template <typename T>
1144inline bool intersect(const line<T, 3>& line,
1145 const quadratic_bezier<T, 3>& bezier,
1146 const std::size_t& steps = 1000);
1147template <typename T>
1148inline bool intersect(const line<T, 3>& line, const cubic_bezier<T, 3>& bezier,
1149 const std::size_t& steps = 1000);
1150template <typename T>
1152template <typename T>
1154 const rectangle<T>& rectangle);
1155template <typename T>
1157 const quadratic_bezier<T, 2>& bezier,
1158 const std::size_t& steps = 1000);
1159template <typename T>
1161 const cubic_bezier<T, 2>& bezier,
1162 const std::size_t& steps = 1000);
1163template <typename T>
1164inline bool intersect(const rectangle<T>& rectangle1,
1165 const rectangle<T>& rectangle2);
1166template <typename T>
1167inline bool intersect(const triangle<T, 2>& triangle1,
1168 const triangle<T, 2>& triangle2);
1169template <typename T>
1170inline bool intersect(const rectangle<T>& rectangle, const circle<T>& circle);
1171template <typename T>
1173 const quadratic_bezier<T, 2>& bezier,
1174 const std::size_t& steps = 1000);
1175template <typename T>
1177 const cubic_bezier<T, 2>& bezier,
1178 const std::size_t& steps = 1000);
1179template <typename T>
1180inline bool intersect(const quadix<T, 2>& quadix,
1181 const quadratic_bezier<T, 2>& bezier,
1182 const std::size_t& steps = 1000);
1183template <typename T>
1184inline bool intersect(const quadix<T, 2>& quadix,
1185 const cubic_bezier<T, 2>& bezier,
1186 const std::size_t& steps = 1000);
1187template <typename T>
1188inline bool intersect(const circle<T>& circle1, const circle<T>& circle2);
1189template <typename T>
1190inline bool intersect(const circle<T>& circle,
1191 const quadratic_bezier<T, 2>& bezier,
1192 const std::size_t& steps = 1000);
1193template <typename T>
1194inline bool intersect(const circle<T>& circle, const cubic_bezier<T, 2>& bezier,
1195 const std::size_t& steps = 1000);
1196template <typename T>
1197inline bool intersect(const box<T, 3>& box, const sphere<T>& sphere);
1198template <typename T>
1199inline bool intersect(const sphere<T>& sphere1, const sphere<T>& sphere2);
1200template <typename T>
1201inline bool intersect(const sphere<T>& sphere,
1202 const quadratic_bezier<T, 3>& bezier,
1203 const std::size_t& steps = 1000);
1204template <typename T>
1205inline bool intersect(const sphere<T>& sphere, const cubic_bezier<T, 3>& bezier,
1206 const std::size_t& steps = 1000);
1207template <typename T>
1208inline bool intersect(const ray<T, 2>& ray1, const ray<T, 2>& ray2);
1209template <typename T>
1210inline bool intersect(const ray<T, 3>& ray1, const ray<T, 3>& ray2);
1211template <typename T>
1212inline bool intersect(const ray<T, 2>& ray, const segment<T, 2>& segment);
1213template <typename T>
1214inline bool intersect(const ray<T, 3>& ray, const segment<T, 3>& segment);
1215template <typename T>
1216inline bool intersect(const ray<T, 2>& ray, const rectangle<T>& rectangle);
1217template <typename T>
1218inline bool intersect(const ray<T, 3>& ray, const box<T, 3>& box);
1219template <typename T>
1220inline bool intersect(const ray<T, 2>& ray, const triangle<T, 2>& triangle);
1221template <typename T>
1222inline bool intersect(const ray<T, 3>& ray, const triangle<T, 3>& triangle);
1223template <typename T>
1224inline bool intersect(const ray<T, 2>& ray, const quadix<T, 2>& quadix);
1225template <typename T>
1226inline bool intersect(const ray<T, 2>& ray, const circle<T>& circle);
1227template <typename T>
1228inline bool intersect(const ray<T, 3>& ray, const sphere<T>& sphere);
1229template <typename T>
1230inline bool intersect(const ray<T, 3>& ray, const plane<T, 3>& plane);
1231template <typename T>
1232inline bool intersect(const ray<T, 2>& ray, const polygon<T, 2>& polygon);
1233template <typename T>
1234inline bool intersect(const plane<T, 3>& plane1, const plane<T, 3>& plane2);
1235template <typename T>
1236inline bool intersect(const plane<T, 3>& plane, const sphere<T>& sphere);
1237template <typename T>
1238inline bool intersect(const plane<T, 3>& plane, const line<T, 3>& line);
1239
1240template <typename T>
1241inline 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
1245template <typename T>
1246inline bool simple_intersect(const point2d<T>& point1, const point2d<T>& point2,
1247 const point2d<T>& point3,
1248 const point2d<T>& point4);
1249
1250template <typename T>
1251inline bool simple_intersect(const segment<T, 2>& segment1,
1252 const segment<T, 2>& segment2);
1253
1254template <typename T>
1256 const segment<T, 2>& segment2);
1257template <typename T>
1258inline bool intersect_vertical_vertical(const segment<T, 2>& segment1,
1259 const segment<T, 2>& segment2);
1260template <typename T>
1262 const segment<T, 2>& segment2);
1263
1264template <typename T>
1265inline 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
1269template <typename T>
1270inline 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
1275template <typename T>
1277 const point2d<T>& point2,
1278 const point2d<T>& point3,
1279 const point2d<T>& point4);
1280template <typename T>
1282 const segment<T, 2>& segment2);
1283
1284template <typename T>
1285inline 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
1291template <typename T>
1292inline 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
1298template <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
1305template <typename T>
1307 const segment<T, 3>& segment2,
1308 const T& fuzzy = T(0.0));
1309
1310template <typename T>
1312 const line<T, 2>& line);
1313
1314template <typename T>
1316 const line<T, 3>& line,
1317 const T& fuzzy = T(0.0));
1318
1319template <typename T>
1321 const plane<T, 3>& plane);
1322
1323template <typename T, typename OutputIterator>
1325 const quadratic_bezier<T, 2>& bezier,
1326 OutputIterator out,
1327 const std::size_t& steps = 1000);
1328
1329template <typename T, typename OutputIterator>
1331 const cubic_bezier<T, 2>& bezier,
1332 OutputIterator out,
1333 const std::size_t& steps = 1000);
1334
1335template <typename T, typename OutputIterator>
1337 const quadratic_bezier<T, 3>& bezier,
1338 OutputIterator out,
1339 const std::size_t& steps = 1000);
1340
1341template <typename T, typename OutputIterator>
1343 const cubic_bezier<T, 3>& bezier,
1344 OutputIterator out,
1345 const std::size_t& steps = 1000);
1346
1347template <typename T>
1349 const line<T, 2>& line2);
1350
1351template <typename T>
1353 const line<T, 3>& line2,
1354 const T& fuzzy = T(0.0));
1355
1356template <typename T>
1357inline void intersection_point(const circle<T>& circle1,
1358 const circle<T>& circle2, point2d<T>& point1,
1359 point2d<T>& point2);
1360
1361template <typename T, typename OutputIterator>
1364 OutputIterator out);
1365
1366template <typename T>
1369 point3d<T>& ipoint);
1370
1371template <typename T>
1373 const plane<T, 3>& plane);
1374
1375template <typename T, typename OutputIterator>
1376inline 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
1380template <typename T, typename OutputIterator>
1382 const circle<T>& circle, OutputIterator out);
1383
1384template <typename T, typename OutputIterator>
1386 OutputIterator out);
1387
1388template <typename T, typename OutputIterator>
1390 const sphere<T>& sphere, OutputIterator out);
1391
1392template <typename T, typename OutputIterator>
1394 OutputIterator out);
1395
1396template <typename T>
1398 const ray<T, 2>& ray2);
1399
1400template <typename T>
1402 const triangle<T, 3>& triangle);
1403
1404template <typename T>
1406 const plane<T, 3>& plane);
1407
1408template <typename T, typename OutputIterator>
1410 OutputIterator out);
1411
1412template <typename T, typename OutputIterator>
1414 OutputIterator out);
1415
1416template <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
1422template <typename T>
1423inline T normalize_angle(const T& angle);
1424
1425template <typename T>
1426inline T vertical_mirror(const T& angle);
1427
1428template <typename T>
1429inline T horizontal_mirror(const T& angle);
1430
1431template <typename T>
1432inline unsigned int quadrant(const T& angle);
1433
1434template <typename T>
1435inline unsigned int quadrant(const T& x, const T& y);
1436
1437template <typename T>
1438inline unsigned int quadrant(const point2d<T>& point);
1439
1440template <typename T>
1441inline T vertex_angle(const T& x1, const T& y1, const T& x2, const T& y2,
1442 const T& x3, const T& y3);
1443
1444template <typename T>
1445inline T vertex_angle(const point2d<T>& point1, const point2d<T>& point2,
1446 const point2d<T>& point3);
1447
1448template <typename T>
1449inline 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
1453template <typename T>
1454inline T vertex_angle(const point3d<T>& point1, const point3d<T>& point2,
1455 const point3d<T>& point3);
1456
1457template <typename T>
1458inline 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);
1461template <typename T>
1462inline T oriented_vertex_angle(const point2d<T>& point1,
1463 const point2d<T>& point2,
1464 const point2d<T>& point3,
1465 const int orient = Clockwise);
1466template <typename T>
1467inline T cartesian_angle(const T& x, const T& y);
1468
1469template <typename T>
1470inline T cartesian_angle(const point2d<T>& point);
1471
1472template <typename T>
1473inline T robust_cartesian_angle(const T& x, const T& y);
1474
1475template <typename T>
1476inline T robust_cartesian_angle(const point2d<T>& point);
1477
1478template <typename T>
1479inline T cartesian_angle(const T& x, const T& y, const T& ox, const T& oy);
1480
1481template <typename T>
1482inline T cartesian_angle(const point2d<T>& point, const point2d<T>& origin);
1483
1484template <typename T>
1485inline T robust_cartesian_angle(const T& x, const T& y, const T& ox,
1486 const T& oy);
1487
1488template <typename T>
1489inline T robust_cartesian_angle(const point2d<T>& point,
1490 const point2d<T>& origin);
1491
1492template <typename T>
1493inline 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
1497template <typename T>
1498inline 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
1502template <typename T>
1503inline bool parallel(const segment<T, 2>& segment1,
1504 const segment<T, 2>& segment2,
1505 const T& epsilon = T(Epsilon));
1506
1507template <typename T>
1508inline bool parallel(const line<T, 2>& line1, const line<T, 2>& line2,
1509 const T& epsilon = T(Epsilon));
1510
1511template <typename T>
1512inline 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
1517template <typename T>
1518inline 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
1522template <typename T>
1523inline bool parallel(const segment<T, 3>& segment1,
1524 const segment<T, 3>& segment2,
1525 const T& epsilon = T(Epsilon));
1526
1527template <typename T>
1528inline bool parallel(const line<T, 3>& line1, const line<T, 3>& line2,
1529 const T& epsilon = T(Epsilon));
1530
1531template <typename T>
1532inline 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
1536template <typename T>
1537inline 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
1541template <typename T>
1542inline bool robust_parallel(const segment<T, 2>& segment1,
1543 const segment<T, 2>& segment2,
1544 const T& epsilon = T(Epsilon));
1545
1546template <typename T>
1547inline bool robust_parallel(const line<T, 2>& line1, const line<T, 2>& line2,
1548 const T& epsilon = T(Epsilon));
1549
1550template <typename T>
1551inline bool robust_parallel(const line<T, 2>& line,
1552 const segment<T, 2>& segment,
1553 const T& epsilon = T(Epsilon));
1554
1555template <typename T>
1556inline 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
1561template <typename T>
1562inline 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
1566template <typename T>
1567inline bool robust_parallel(const segment<T, 3>& segment1,
1568 const segment<T, 3>& segment2,
1569 const T& epsilon = T(Epsilon));
1570
1571template <typename T>
1572inline bool robust_parallel(const line<T, 3>& line1, const line<T, 3>& line2,
1573 const T& epsilon = T(Epsilon));
1574
1575template <typename T>
1576inline bool robust_parallel(const line<T, 3>& line,
1577 const segment<T, 3>& segment,
1578 const T& epsilon = T(Epsilon));
1579
1580template <typename T>
1581inline 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
1585template <typename T>
1586inline 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
1590template <typename T>
1591inline bool perpendicular(const segment<T, 2>& segment1,
1592 const segment<T, 2>& segment2,
1593 const T& epsilon = T(Epsilon));
1594
1595template <typename T>
1596inline bool perpendicular(const line<T, 2>& line1, const line<T, 2>& line2,
1597 const T& epsilon = T(Epsilon));
1598
1599template <typename T>
1601 const T& epsilon = T(Epsilon));
1602
1603template <typename T>
1604inline 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
1609template <typename T>
1610inline 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
1614template <typename T>
1615inline bool perpendicular(const segment<T, 3>& segment1,
1616 const segment<T, 3>& segment2,
1617 const T& epsilon = T(Epsilon));
1618
1619template <typename T>
1620inline bool perpendicular(const line<T, 3>& line1, const line<T, 3>& line2,
1621 const T& epsilon = T(Epsilon));
1622
1623template <typename T>
1624inline 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
1629template <typename T>
1630inline 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
1636template <typename T>
1637inline bool robust_perpendicular(const segment<T, 2>& segment1,
1638 const segment<T, 2>& segment2,
1639 const T& epsilon = T(Epsilon));
1640
1641template <typename T>
1642inline bool robust_perpendicular(const line<T, 2>& line1,
1643 const line<T, 2>& line2,
1644 const T& epsilon = T(Epsilon));
1645
1646template <typename T>
1647inline 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
1653template <typename T>
1654inline 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
1660template <typename T>
1661inline bool robust_perpendicular(const segment<T, 3>& segment1,
1662 const segment<T, 3>& segment2,
1663 const T& epsilon = T(Epsilon));
1664
1665template <typename T>
1666inline bool robust_perpendicular(const line<T, 3>& line1,
1667 const line<T, 3>& line2,
1668 const T& epsilon = T(Epsilon));
1669
1670template <typename T>
1672 const segment<T, 2>& segment,
1673 const T& epsilon = T(Epsilon));
1674
1675template <typename T>
1676inline 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);
1679template <typename T>
1680inline bool line_to_line_intersect(const line<T, 2>& line1,
1681 const line<T, 2>& line2);
1682
1683template <typename T>
1684inline 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
1689template <typename T>
1690inline bool rectangle_to_rectangle_intersect(const rectangle<T>& rectangle1,
1691 const rectangle<T>& rectangle2);
1692
1693template <typename T>
1694inline 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
1699template <typename T>
1700inline bool box_to_box_intersect(const box<T, 3>& box1, const box<T, 3>& box2);
1701
1702template <typename T, unsigned int Dimension, typename Simplex, typename Bezier>
1703inline bool simplex_to_bezier_intersect(const Simplex& simplex,
1704 const Bezier& bezier,
1705 const std::size_t& steps);
1706
1707template <typename T, unsigned int Dimension, typename Bezier,
1708 typename Iterator>
1709inline bool simplex_to_bezier_intersect(const Iterator& begin,
1710 const Iterator& end,
1711 const Bezier& bezier,
1712 const std::size_t& steps);
1713
1714template <typename T>
1715inline 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
1719template <typename T>
1720inline bool rectangle_within_rectangle(const rectangle<T>& rectangle1,
1721 const rectangle<T>& rectangle2);
1722
1723template <typename T>
1724inline 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
1728template <typename T>
1729inline bool box_within_box(const box<T, 3>& box1, const box<T, 3>& box2);
1730
1731template <typename T>
1732inline 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
1736template <typename T>
1738 const rectangle<T>& rectangle);
1739
1740template <typename T>
1741inline 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);
1745template <typename T>
1747 const rectangle<T>& rectangle);
1748
1749template <typename T>
1750inline 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
1754template <typename T>
1756 const rectangle<T>& rectangle);
1757
1758template <typename T>
1759inline 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
1764template <typename T>
1766 const rectangle<T>& rectangle);
1767
1768template <typename T>
1770 const rectangle<T>& rectangle);
1771
1772template <typename T>
1773inline 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
1778template <typename T>
1779inline bool sphere_within_box(const sphere<T>& sphere, const box<T, 3>& box);
1780
1781template <typename T>
1782inline 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);
1787template <typename T>
1789 const box<T, 3>& box);
1790
1791template <typename T>
1792inline 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
1797template <typename T>
1799 const box<T, 3>& box);
1800
1801template <typename T>
1802inline 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
1809template <typename T>
1811
1812template <typename T>
1814 const box<T, 3>& box);
1815
1816template <typename T>
1817inline bool circle_in_circle(const circle<T>& circle1,
1818 const circle<T>& circle2);
1819
1820template <typename T>
1821inline bool is_tangent(const segment<T, 2>& segment, const circle<T>& circle);
1822
1823template <typename T>
1824inline 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);
1827template <typename T>
1829 const point2d<T>& point1,
1830 const point2d<T>& point2,
1831 point2d<T>& reflection_point);
1832
1833template <typename T>
1835 const std::size_t& edge_index);
1836template <typename T>
1838 const std::size_t& edge_index);
1839template <typename T>
1841 const std::size_t& edge_index);
1842template <typename T>
1844 const std::size_t& edge_index);
1845template <typename T>
1847 const std::size_t& edge);
1848template <typename T>
1850 const std::size_t& edge);
1851template <typename T>
1853 const std::size_t& edge);
1854
1855template <typename T>
1857 const std::size_t& corner);
1858template <typename T>
1860 const std::size_t& corner);
1861
1862template <typename T>
1864template <typename T>
1866
1867template <typename T>
1869 const std::size_t& corner_index);
1870template <typename T>
1872 const std::size_t& corner_index);
1873
1874template <typename T>
1876 const std::size_t& bisector);
1877template <typename T>
1879 const std::size_t& bisector);
1880
1881template <typename T>
1883 const triangle<T, 2>& triangle, const std::size_t& corner,
1884 const std::size_t& opposing_corner);
1885
1886template <typename T>
1888 const triangle<T, 3>& triangle, const std::size_t& corner,
1889 const std::size_t& opposing_corner);
1890
1891template <typename T>
1893 const std::size_t& median);
1894template <typename T>
1896 const std::size_t& median);
1897
1898template <typename T>
1900 const std::size_t& symmedian);
1901template <typename T>
1903 const std::size_t& symmedian);
1904
1905template <typename T>
1907template <typename T>
1909
1910template <typename T>
1912 const std::size_t& corner);
1913template <typename T>
1915 const std::size_t& corner);
1916
1917template <typename T>
1919
1920template <typename T>
1922 const point2d<T>& point,
1923 const std::size_t& median);
1924
1925template <typename T>
1927 const point3d<T>& point,
1928 const std::size_t& median);
1929
1930template <typename T>
1932 const point2d<T>& point);
1933template <typename T>
1935 const point3d<T>& point);
1936
1937template <typename T>
1939 const point2d<T>& point);
1940template <typename T>
1942 const point3d<T>& point);
1943
1944template <typename T>
1945inline bool point_in_rectangle(const T& px, const T& py, const T& x1,
1946 const T& y1, const T& x2, const T& y2);
1947
1948template <typename T>
1949inline bool point_in_rectangle(const point2d<T>& point, const T& x1,
1950 const T& y1, const T& x2, const T& y2);
1951
1952template <typename T>
1953inline bool point_in_rectangle(const T& px, const T& py,
1954 const rectangle<T>& rectangle);
1955
1956template <typename T>
1957inline bool point_in_rectangle(const point2d<T>& point,
1958 const rectangle<T>& rectangle);
1959
1960template <typename T>
1961inline bool point_in_rectangle(const point2d<T>& point,
1962 const point2d<T>& rect_point1,
1963 point2d<T>& rect_point2);
1964
1965template <typename T>
1966inline bool point_in_rectangle(const point2d<T>& point,
1967 const segment<T, 2>& segment);
1968
1969template <typename T>
1970inline 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
1974template <typename T>
1975inline 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
1978template <typename T>
1979inline bool point_in_box(const T& px, const T& py, const T& pz,
1980 const box<T, 3>& box);
1981
1982template <typename T>
1983inline bool point_in_box(const point3d<T>& point, const box<T, 3>& box);
1984
1985template <typename T>
1986inline bool point_in_box(const point3d<T>& point, const point3d<T>& box_point1,
1987 const point3d<T>& box_point2);
1988
1989template <typename T>
1990inline bool point_in_box(const point3d<T>& point, const segment<T, 3>& segment);
1991
1992template <typename T>
1993inline 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);
1996template <typename T>
1997inline bool point_in_triangle(const point2d<T>& point, const point2d<T>& point1,
1998 const point2d<T>& point2,
1999 const point2d<T>& point3);
2000
2001template <typename T>
2002inline bool point_in_triangle(const T& px, const T& py,
2003 const triangle<T, 2>& triangle);
2004
2005template <typename T>
2006inline bool point_in_triangle(const point2d<T>& point,
2007 const triangle<T, 2>& triangle);
2008
2009template <typename T>
2010inline 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
2014template <typename T>
2015inline 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
2019template <typename T>
2020inline bool point_in_quadix(const T& px, const T& py,
2021 const quadix<T, 2>& quadix);
2022template <typename T>
2023inline bool point_in_quadix(const point2d<T>& point,
2024 const quadix<T, 2>& quadix);
2025
2026template <typename T>
2027inline bool point_in_circle(const T& px, const T& py, const T& cx, const T& cy,
2028 const T& radius);
2029
2030template <typename T>
2031inline bool point_in_circle(const T& px, const T& py, const circle<T>& circle);
2032
2033template <typename T>
2034inline bool point_in_circle(const point2d<T>& point, const circle<T>& circle);
2035
2036template <typename T>
2037inline 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
2040template <typename T>
2041inline bool point_in_sphere(const T& px, const T& py, const T& pz,
2042 const sphere<T>& sphere);
2043
2044template <typename T>
2045inline bool point_in_sphere(const point3d<T>& point, const sphere<T>& sphere);
2046
2047template <typename T>
2048inline 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
2052template <typename T>
2054 const point2d<T>& point1,
2055 const point2d<T>& point2,
2056 const point2d<T>& point3);
2057
2058template <typename T>
2061
2062template <typename T>
2063inline 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);
2066template <typename T>
2067inline 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
2072template <typename T>
2073inline bool point_on_segment(const point2d<T>& point,
2074 const segment<T, 2>& segment);
2075
2076template <typename T>
2077inline bool point_on_segment(const point3d<T>& point,
2078 const segment<T, 3>& segment);
2079
2080template <typename T>
2081inline bool point_on_ray(const T& px, const T& py, const T& ox, const T& oy,
2082 const T& dx, const T& dy);
2083
2084template <typename T>
2085inline 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
2089template <typename T>
2090inline bool point_on_ray(const point2d<T>& point, const ray<T, 2>& ray);
2091
2092template <typename T>
2093inline bool point_on_ray(const point3d<T>& point, const ray<T, 3>& ray);
2094
2095template <typename T>
2096inline bool point_on_rectangle(const T& px, const T& py, const T& x1,
2097 const T& y1, const T& x2, const T& y2);
2098
2099template <typename T>
2100inline bool point_on_rectangle(const point2d<T>& point, const T& x1,
2101 const T& y1, const T& x2, const T& y2);
2102
2103template <typename T>
2104inline bool point_on_rectangle(const T& px, const T& py,
2105 const rectangle<T>& rectangle);
2106
2107template <typename T>
2108inline bool point_on_rectangle(const point2d<T>& point,
2109 const rectangle<T>& rectangle);
2110
2111template <typename T>
2112inline 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);
2115template <typename T>
2116inline bool point_on_triangle(const point2d<T>& point, const point2d<T>& point1,
2117 const point2d<T>& point2,
2118 const point2d<T>& point3);
2119
2120template <typename T>
2121inline bool point_on_triangle(const T& px, const T& py,
2122 const triangle<T, 2>& triangle);
2123
2124template <typename T>
2125inline bool point_on_triangle(const point2d<T>& point,
2126 const triangle<T, 2>& triangle);
2127
2128template <typename T>
2129inline 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
2133template <typename T>
2134inline 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
2138template <typename T>
2139inline bool point_on_quadix(const T& px, const T& py,
2140 const quadix<T, 2>& quadix);
2141template <typename T>
2142inline bool point_on_quadix(const point2d<T>& point,
2143 const quadix<T, 2>& quadix);
2144
2145template <typename T>
2146inline bool point_on_circle(const T& px, const T& py, const T& cx, const T& cy,
2147 const T& radius);
2148
2149template <typename T>
2150inline bool point_on_circle(const T& px, const T& py, const circle<T>& circle);
2151
2152template <typename T>
2153inline bool point_on_circle(const point2d<T>& point, const circle<T>& circle);
2154
2155template <typename T>
2156inline 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
2161template <typename T>
2162inline 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
2167template <typename T>
2168inline 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
2173template <typename T>
2174inline 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
2179template <typename T>
2181 const triangle<T, 2>& triangle);
2182
2183template <typename T>
2185 const triangle<T, 3>& triangle);
2186
2187template <typename T>
2189 const triangle<T, 2>& triangle);
2190
2191template <typename T>
2193
2194template <typename T>
2196
2197template <typename T>
2198inline void create_equilateral_triangle(const T& x1, const T& y1, const T& x2,
2199 const T& y2, T& x3, T& y3);
2200
2201template <typename T>
2202inline void create_equilateral_triangle(const point2d<T>& point1,
2203 const point2d<T>& point2,
2204 point2d<T>& point3);
2205
2206template <typename T>
2207inline triangle<T, 2> create_equilateral_triangle(const T& x1, const T& y1,
2208 const T& x2, const T& y2);
2209
2210template <typename T>
2212 const point2d<T>& point2);
2213
2214template <typename T>
2215inline triangle<T, 2> create_equilateral_triangle(const T& cx, const T& cy,
2216 const T& side_length);
2217template <typename T>
2219 const point2d<T>& center_point, const T& side_length);
2220
2221template <typename T>
2223 const point2d<T>& point2,
2224 const T& angle);
2225template <typename T>
2227 const T& angle);
2228
2229template <typename T>
2231 const point2d<T>& point2, const T& angle1,
2232 const T& angle2);
2233template <typename T>
2235 const T& angle1, const T& angle2);
2236
2237template <typename T>
2239
2240template <typename T>
2242 const point2d<T>& point);
2243template <typename T>
2245 const point3d<T>& point);
2246
2247template <typename T>
2249 const point2d<T>& point);
2250template <typename T>
2252 const point3d<T>& point);
2253
2254template <typename T>
2256 const triangle<T, 2>& triangle);
2257template <typename T>
2259 const triangle<T, 3>& triangle);
2260
2261template <typename T>
2263 const triangle<T, 2>& triangle);
2264
2265template <typename T>
2267 const triangle<T, 2>& triangle);
2268
2269template <typename T>
2271 const triangle<T, 2>& triangle);
2272
2273template <typename T>
2275 const triangle<T, 2>& triangle);
2276
2277template <typename T>
2279template <typename T>
2281
2282template <typename T>
2284template <typename T>
2286
2287template <typename T>
2289 const point2d<T>& point);
2290
2291template <typename T>
2293template <typename T>
2295
2296template <typename T>
2298 const triangle<T, 2>& triangle);
2299template <typename T>
2301 const triangle<T, 3>& triangle);
2302
2303template <typename T>
2305 const triangle<T, 2>& triangle);
2306
2307template <typename T>
2309template <typename T>
2311
2312template <typename T>
2314template <typename T>
2316
2317template <typename T>
2319
2320template <typename T>
2322template <typename T>
2324
2325template <typename T>
2327
2328template <typename T>
2330 const triangle<T, 2>& triangle, const point2d<T>& point);
2331
2332template <typename T>
2334 const triangle<T, 2>& triangle);
2335
2336template <typename T>
2338 const triangle<T, 2>& triangle);
2339
2340template <typename T>
2342 const wykobi::point2d<T>& p2,
2345
2346template <typename T>
2347inline 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
2350template <typename T>
2351inline void create_equilateral_quadix(const point2d<T>& point1,
2352 const point2d<T>& point2,
2353 point2d<T>& point3, point2d<T>& point4);
2354
2355template <typename T>
2356inline quadix<T, 2> create_equilateral_quadix(const T& x1, const T& y1,
2357 const T& x2, const T& y2);
2358
2359template <typename T>
2361 const point2d<T>& point2);
2362
2363template <typename T>
2365
2366template <typename T>
2367inline quadix<T, 2> create_equilateral_quadix(const T& cx, const T& cy,
2368 const T& side_length);
2369
2370template <typename T>
2372 const T& side_length);
2373
2374template <typename T>
2375inline 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
2378template <typename T>
2380 const point2d<T>& point2,
2381 const point2d<T>& point3);
2382
2383template <typename T>
2385
2386template <typename T>
2387inline 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
2392template <typename T>
2393inline point2d<T> trilateration(const circle<T>& c0, const circle<T>& c1,
2394 const circle<T>& c2);
2395
2396template <typename T>
2397inline 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
2400template <typename T>
2401inline 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
2405template <typename T>
2406inline point2d<T> incenter(const point2d<T>& point1, const point2d<T>& point2,
2407 const point2d<T>& point3);
2408
2409template <typename T>
2410inline point3d<T> incenter(const point3d<T>& point1, const point3d<T>& point2,
2411 const point3d<T>& point3);
2412
2413template <typename T>
2415
2416template <typename T>
2418
2419template <typename T>
2420inline 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
2423template <typename T>
2424inline 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
2428template <typename T>
2429inline point2d<T> circumcenter(const point2d<T>& point1,
2430 const point2d<T>& point2,
2431 const point2d<T>& point3);
2432
2433template <typename T>
2434inline point3d<T> circumcenter(const point3d<T>& point1,
2435 const point3d<T>& point2,
2436 const point3d<T>& point3);
2437
2438template <typename T>
2440
2441template <typename T>
2443
2444template <typename T>
2445inline circle<T> circumcircle(const T& x1, const T& y1, const T& x2,
2446 const T& y2, const T& x3, const T& y3);
2447
2448template <typename T>
2449inline circle<T> circumcircle(const point2d<T>& point1,
2450 const point2d<T>& point2,
2451 const point2d<T>& point3);
2452
2453template <typename T>
2455
2456template <typename T>
2457inline 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
2461template <typename T>
2462inline sphere<T> circumsphere(const point3d<T>& point1,
2463 const point3d<T>& point2,
2464 const point3d<T>& point3);
2465
2466template <typename T>
2468
2469template <typename T>
2470inline circle<T> inscribed_circle(const T& x1, const T& y1, const T& x2,
2471 const T& y2, const T& x3, const T& y3);
2472
2473template <typename T>
2475 const point2d<T>& point2,
2476 const point2d<T>& point3);
2477
2478template <typename T>
2480
2481template <typename T>
2482inline 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
2486template <typename T>
2488 const point3d<T>& point2,
2489 const point3d<T>& point3);
2490
2491template <typename T>
2493
2494template <typename T>
2495inline 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
2498template <typename T>
2500 const point2d<T>& point2,
2501 const point2d<T>& point3);
2502
2503template <typename T>
2505
2506template <typename T>
2508
2509template <typename T>
2511
2512template <typename T>
2514 const std::size_t& corner);
2515
2516template <typename T>
2518 const std::size_t& corner);
2519
2520template <typename T>
2521inline circle<T> excircle(const triangle<T, 2>& triangle, const std::size_t& i);
2522
2523template <typename T>
2525
2526template <typename T>
2528
2529template <typename T>
2531 const circle<T>& circle2);
2532
2533template <typename T>
2535 const sphere<T>& sphere2);
2536
2537template <typename T>
2539 const point2d<T>& point, point2d<T>& point1,
2540 point2d<T>& point2);
2541
2542template <typename T>
2543inline void circle_internal_tangent_lines(const circle<T>& circle0,
2544 const circle<T>& circle1,
2545 std::vector<line<T, 2> >& lines);
2546
2547template <typename T>
2549 const circle<T>& circle0, const circle<T>& circle1,
2550 std::vector<segment<T, 2> >& segments);
2551
2552template <typename T>
2553inline void circle_outer_tangent_lines(const circle<T>& circle0,
2554 const circle<T>& circle1,
2555 std::vector<line<T, 2> >& lines);
2556
2557template <typename T>
2559 const circle<T>& circle0, const circle<T>& circle1,
2560 std::vector<segment<T, 2> >& segments);
2561
2562template <typename T>
2564 const point2d<T>& point);
2565
2566template <typename T>
2567inline 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
2571template <typename T>
2572inline 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
2576template <typename T>
2577inline 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
2581template <typename T>
2582inline 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
2588template <typename T>
2589inline 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
2595template <typename T>
2596inline 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
2601template <typename T>
2603 const point2d<T>& point2,
2604 const point2d<T>& point3);
2605template <typename T>
2607 const point2d<T>& point2,
2608 const point2d<T>& point3);
2609template <typename T>
2611 const point2d<T>& point2,
2612 const point2d<T>& point3);
2613template <typename T>
2615 const point3d<T>& point2,
2616 const point3d<T>& point3);
2617template <typename T>
2619 const point3d<T>& point2,
2620 const point3d<T>& point3);
2621template <typename T>
2623 const point3d<T>& point2,
2624 const point3d<T>& point3);
2625
2626template <typename T>
2627inline line<T, 2> create_perpendicular_bisector(const T& x1, const T& y1,
2628 const T& x2, const T& y2);
2629template <typename T>
2631 const point2d<T>& point2);
2632template <typename T>
2634
2635template <typename T>
2637 const line<T, 2>& line);
2638
2639template <typename T>
2640inline 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
2645template <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
2650template <typename T>
2651inline 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
2656template <typename T>
2657inline 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
2663template <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
2668template <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
2673template <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
2678template <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
2683template <typename T>
2684inline 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
2689template <typename T>
2690inline 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
2696template <typename T>
2697inline 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
2701template <typename T>
2702inline 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
2708template <typename T>
2710 const segment<T, 2>& segment, const point2d<T>& point);
2711
2712template <typename T>
2714 const segment<T, 3>& segment, const point3d<T>& point);
2715
2716template <typename T>
2717inline 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
2721template <typename T>
2722inline 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
2728template <typename T>
2730 const point2d<T>& point);
2731
2732template <typename T>
2734 const point3d<T>& point);
2735
2736template <typename T>
2737inline 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
2741template <typename T>
2742inline 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
2748template <typename T>
2750 const point2d<T>& point);
2751
2752template <typename T>
2754 const point3d<T>& point);
2755
2756template <typename T>
2757inline 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
2763template <typename T>
2764inline 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
2770template <typename T>
2772 const triangle<T, 2>& triangle, const T& px, const T& py);
2773
2774template <typename T>
2776 const triangle<T, 2>& triangle, const point2d<T>& point);
2777
2778template <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
2784template <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
2790template <typename T>
2792 const triangle<T, 3>& triangle, const T& px, const T& py, const T& pz);
2793
2794template <typename T>
2796 const triangle<T, 3>& triangle, const point3d<T>& point);
2797
2798template <typename T>
2799inline 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
2804template <typename T>
2806 const T& x1, const T& y1, const T& x2, const T& y2, const T& px,
2807 const T& py);
2808
2809template <typename T>
2811 const rectangle<T>& rectangle, const T& px, const T& py);
2812
2813template <typename T>
2815 const rectangle<T>& rectangle, const point2d<T>& point);
2816
2817template <typename T>
2818inline 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
2824template <typename T>
2825inline 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
2831template <typename T>
2833 const T& px, const T& py,
2834 const T& pz);
2835
2836template <typename T>
2838 const point3d<T>& point);
2839
2840template <typename T>
2841inline 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
2848template <typename T>
2849inline 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);
2854template <typename T>
2856 const point2d<T>& point);
2857
2858template <typename T>
2860 const point2d<T>& point);
2861
2862template <typename T>
2864 const point3d<T>& point);
2865
2866template <typename T>
2868 const rectangle<T>& rectangle, const point2d<T>& point);
2869
2870template <typename T>
2872 const circle<T>& circle, const segment<T, 2>& segment);
2873
2874template <typename T>
2876 const sphere<T>& sphere, const segment<T, 3>& segment);
2877
2878template <typename T>
2880 const point3d<T>& point);
2881
2882template <typename T>
2884 const quadratic_bezier<T, 2>& bezier, const point2d<T>& point,
2885 const std::size_t& steps = 1000);
2886
2887template <typename T>
2889 const cubic_bezier<T, 2>& bezier, const point2d<T>& point,
2890 const std::size_t& steps = 1000);
2891
2892template <typename T>
2894 const quadratic_bezier<T, 3>& bezier, const point3d<T>& point,
2895 const std::size_t& steps = 1000);
2896
2897template <typename T>
2899 const cubic_bezier<T, 3>& bezier, const point3d<T>& point,
2900 const std::size_t& steps = 1000);
2901
2902template <typename T>
2904 const circle<T>& circle2);
2905
2906template <typename T>
2908 const sphere<T>& sphere2);
2909
2910template <typename T>
2912 const polygon<T, 2>& polygon, const point2d<T>& point);
2913
2914template <typename T>
2915inline 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
2919template <typename T>
2920inline 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
2926template <typename T>
2928 const segment<T, 2>& segment);
2929
2930template <typename T>
2932 const segment<T, 3>& segment);
2933
2934template <typename T>
2935inline 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
2939template <typename T>
2940inline 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
2946template <typename T>
2948 const line<T, 2>& line);
2949
2950template <typename T>
2952 const line<T, 3>& line);
2953
2954template <typename T>
2955inline 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
2960template <typename T>
2962 const point2d<T>& point, const triangle<T, 2>& triangle);
2963
2964template <typename T>
2965inline 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
2969template <typename T>
2971 const point2d<T>& point, const rectangle<T>& rectangle);
2972
2973template <typename T>
2974inline void segment_mid_point(const T& x1, const T& y1, const T& x2,
2975 const T& y2, T& midx, T& midy);
2976
2977template <typename T>
2978inline void segment_mid_point(const segment<T, 2>& segment, T& midx, T& midy);
2979
2980template <typename T>
2982 const point2d<T>& point2);
2983
2984template <typename T>
2986
2987template <typename T>
2988inline 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
2992template <typename T>
2993inline void segment_mid_point(const segment<T, 3>& segment, T& midx, T& midy,
2994 T& midz);
2995
2996template <typename T>
2998 const point3d<T>& point2);
2999
3000template <typename T>
3002
3003template <typename T>
3004inline void centroid(const T& x1, const T& y1, const T& x2, const T& y2, T& x,
3005 T& y);
3006
3007template <typename T>
3008inline point2d<T> centroid(const point2d<T>& point1, const point2d<T>& point2);
3009
3010template <typename T>
3012
3013template <typename T>
3014inline 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
3017template <typename T>
3018inline 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
3022template <typename T>
3023inline 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
3027template <typename T>
3028inline void centroid(const triangle<T, 2>& triangle, T& x, T& y);
3029template <typename T>
3030inline void centroid(const triangle<T, 3>& triangle, T& x, T& y, T& z);
3031template <typename T>
3032inline void centroid(const quadix<T, 2>& quadix, T& x, T& y);
3033template <typename T>
3034inline void centroid(const rectangle<T>& rectangle, T& x, T& y);
3035template <typename T>
3036inline void centroid(const box<T, 3>& box, T& x, T& y, T& z);
3037template <typename T>
3038inline void centroid(const polygon<T, 2>& polygon, T& x, T& y);
3039
3040template <typename T>
3041inline point2d<T> centroid(const point2d<T>& point1, const point2d<T>& point2,
3042 const point2d<T>& point3);
3043template <typename T>
3044inline point2d<T> centroid(const point2d<T>& point1, const point2d<T>& point2,
3045 const point2d<T>& point3, const point2d<T>& point4);
3046template <typename T>
3048template <typename T>
3050template <typename T>
3052template <typename T>
3054template <typename T>
3056template <typename T>
3058
3059template <typename T>
3060inline bool common_center(const circle<T>& circle1, const circle<T>& circle2);
3061template <typename T>
3062inline bool common_center(const sphere<T>& sphere1, const sphere<T>& circle2);
3063
3064template <typename T>
3065inline bool point_in_convex_polygon(const T& px, const T& py,
3066 const polygon<T, 2>& polygon);
3067template <typename T>
3068inline bool point_in_convex_polygon(const point2d<T>& point,
3069 const polygon<T, 2>& polygon);
3070
3071template <typename T>
3072inline bool point_on_polygon_edge(const T& px, const T& py,
3073 const polygon<T, 2>& polygon);
3074template <typename T>
3075inline bool point_on_polygon_edge(const point2d<T>& point,
3076 const polygon<T, 2>& polygon);
3077
3078template <typename T>
3079inline bool point_in_polygon(const T& px, const T& py,
3080 const polygon<T, 2>& polygon);
3081template <typename T>
3082inline bool point_in_polygon(const point2d<T>& point,
3083 const polygon<T, 2>& polygon);
3084
3085template <typename T>
3086inline bool point_in_polygon_winding_number(const T& px, const T& py,
3087 const polygon<T, 2>& polygon);
3088template <typename T>
3090 const polygon<T, 2>& polygon);
3091
3092template <typename T>
3094template <typename T>
3096
3097template <typename T>
3099
3100template <typename T>
3102 const polygon<T, 2>& polygon);
3103
3104template <typename T, typename InputIterator, typename OutputIterator>
3105inline void remove_consecutive_collinear_points(const InputIterator begin,
3106 const InputIterator end,
3107 OutputIterator out);
3108
3109template <typename T>
3110inline bool convex_vertex(const std::size_t& index,
3111 const polygon<T, 2>& polygon,
3112 const int& polygon_orientation = LeftHandSide);
3113
3114template <typename T>
3115inline bool collinear_vertex(const std::size_t& index,
3116 const polygon<T, 2>& polygon);
3117
3118template <typename T>
3119inline bool vertex_is_ear(const std::size_t& index,
3120 const polygon<T, 2>& polygon);
3121
3122template <typename T>
3123inline triangle<T, 2> vertex_triangle(const std::size_t& index,
3124 const polygon<T, 2> polygon);
3125
3126template <typename T>
3128
3129template <typename T>
3131template <typename T>
3133
3134template <typename T>
3136template <typename T>
3138
3139template <typename T>
3141template <typename T>
3143
3144template <typename T>
3145inline bool are_perspective_triangles(const triangle<T, 2>& triangle1,
3146 const triangle<T, 2>& triangle2);
3147template <typename T>
3148inline bool are_perspective_triangles(const triangle<T, 3>& triangle1,
3149 const triangle<T, 3>& triangle2);
3150
3151template <typename T>
3152inline line<T, 2> perspectrix(const triangle<T, 2>& triangle1,
3153 const triangle<T, 2>& triangle2);
3154template <typename T>
3155inline line<T, 3> perspectrix(const triangle<T, 3>& triangle1,
3156 const triangle<T, 3>& triangle2);
3157
3158template <typename T>
3159inline 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
3162template <typename T>
3163inline 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
3167template <typename T>
3168inline point2d<T> mirror(const point2d<T>& point,
3169 const line<T, 2>& mirror_axis);
3170template <typename T>
3172 const line<T, 2>& mirror_axis);
3173template <typename T>
3175 const wykobi::line<T, 2>& mirror_axis);
3176template <typename T>
3178 const line<T, 2>& mirror_axis);
3179template <typename T>
3181 const line<T, 2>& mirror_axis);
3182template <typename T>
3184 const line<T, 2>& mirror_axis);
3185template <typename T>
3186inline circle<T> mirror(const circle<T>& circle, const line<T, 2>& mirror_axis);
3187template <typename T>
3189 const line<T, 2>& mirror_axis);
3190
3191template <typename T>
3192inline point3d<T> mirror(const point3d<T>& point,
3193 const line<T, 3>& mirror_axis);
3194template <typename T>
3196 const line<T, 3>& mirror_axis);
3197template <typename T>
3199 const wykobi::line<T, 3>& mirror_axis);
3200template <typename T>
3201inline box<T, 3> mirror(const box<T, 3>& box, const line<T, 3>& mirror_axis);
3202template <typename T>
3204 const line<T, 3>& mirror_axis);
3205template <typename T>
3207 const line<T, 3>& mirror_axis);
3208template <typename T>
3209inline sphere<T> mirror(const sphere<T>& sphere, const line<T, 3>& mirror_axis);
3210template <typename T>
3212 const line<T, 3>& mirror_axis);
3213
3214template <typename T>
3215inline point3d<T> mirror(const point3d<T>& point,
3216 const plane<T, 3>& mirror_plane);
3217template <typename T>
3219 const plane<T, 3>& mirror_plane);
3220template <typename T>
3222 const plane<T, 3>& mirror_plane);
3223template <typename T>
3224inline box<T, 3> mirror(const box<T, 3>& box, const plane<T, 3>& mirror_plane);
3225template <typename T>
3227 const plane<T, 3>& mirror_plane);
3228template <typename T>
3230 const plane<T, 3>& mirror_plane);
3231template <typename T>
3233 const plane<T, 3>& mirror_plane);
3234template <typename T>
3236 const plane<T, 3>& mirror_plane);
3237
3238template <typename T>
3239inline 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
3243template <typename T>
3244inline point2d<T> nonsymmetric_mirror(const point2d<T>& point, const T& ratio,
3245 const line<T, 2>& line);
3246template <typename T>
3248 const T& ratio,
3249 const line<T, 2>& line);
3250template <typename T>
3252 const T& ratio, const line<T, 2>& line);
3253template <typename T>
3255 const T& ratio,
3256 const line<T, 2>& line);
3257template <typename T>
3259 const T& ratio, const line<T, 2>& line);
3260template <typename T>
3261inline circle<T> nonsymmetric_mirror(const circle<T>& circle, const T& ratio,
3262 const line<T, 2>& line);
3263template <typename T>
3265 const T& ratio,
3266 const line<T, 2>& line);
3267
3268template <typename T>
3269inline point3d<T> nonsymmetric_mirror(const point3d<T>& point, const T& ratio,
3270 const plane<T, 3>& plane);
3271template <typename T>
3273 const T& ratio,
3274 const plane<T, 3>& plane);
3275template <typename T>
3276inline box<T, 3> nonsymmetric_mirror(const box<T, 3>& box, const T& ratio,
3277 const plane<T, 3>& plane);
3278template <typename T>
3280 const T& ratio,
3281 const plane<T, 3>& plane);
3282template <typename T>
3284 const T& ratio,
3285 const plane<T, 3>& plane);
3286template <typename T>
3287inline circle<T> nonsymmetric_mirror(const sphere<T>& sphere, const T& ratio,
3288 const plane<T, 3>& plane);
3289template <typename T>
3291 const T& ratio,
3292 const plane<T, 3>& plane);
3293
3294template <typename T>
3296 const circle<T>& circle);
3297template <typename T>
3299 const sphere<T>& sphere);
3300
3301template <typename T>
3303 const circle<T>& circle);
3304template <typename T>
3306 const sphere<T>& sphere);
3307
3308template <typename T>
3309inline T distance(const T& x1, const T& y1, const T& x2, const T& y2);
3310template <typename T>
3311inline T distance(const T& x1, const T& y1, const T& z1, const T& x2,
3312 const T& y2, const T& z2);
3313template <typename T>
3314inline T distance(const point2d<T>& point1, const point2d<T>& point2);
3315template <typename T>
3316inline T distance(const point3d<T>& point1, const point3d<T>& point2);
3317template <typename T>
3318inline T distance(const curve_point<T, 2>& point1,
3319 const curve_point<T, 2>& point2);
3320template <typename T>
3321inline T distance(const curve_point<T, 3>& point1,
3322 const curve_point<T, 3>& point2);
3323template <typename T>
3324inline T distance(const point2d<T>& point, const segment<T, 2>& segment);
3325template <typename T>
3326inline T distance(const point3d<T>& point, const segment<T, 3>& segment);
3327template <typename T>
3328inline T distance(const point2d<T>& point, const rectangle<T>& rectangle);
3329template <typename T>
3330inline T distance(const point2d<T>& point, const triangle<T, 2>& triangle);
3331template <typename T>
3332inline T distance(const point2d<T>& point, const quadix<T, 2>& quadix);
3333template <typename T>
3334inline T distance(const point2d<T>& point, const ray<T, 2>& ray);
3335template <typename T>
3336inline T distance(const point3d<T>& point, const ray<T, 3>& ray);
3337template <typename T>
3338inline T distance(const point3d<T>& point, const plane<T, 3>& plane);
3339template <typename T>
3340inline T distance(const line<T, 2>& line1, const line<T, 2>& line2);
3341template <typename T>
3342inline T distance(const line<T, 3>& line1, const line<T, 3>& line2);
3343template <typename T>
3344inline T distance(const segment<T, 2>& segment1, const segment<T, 2>& segment2);
3345template <typename T>
3346inline T distance(const segment<T, 3>& segment1, const segment<T, 3>& segment2);
3347template <typename T>
3349template <typename T>
3351template <typename T>
3353template <typename T>
3355template <typename T>
3357template <typename T>
3359template <typename T>
3360inline T distance(const triangle<T, 2>& triangle1,
3361 const triangle<T, 2>& triangle2);
3362template <typename T>
3364 const rectangle<T>& rectangle);
3365template <typename T>
3366inline T distance(const rectangle<T>& rectangle1,
3367 const rectangle<T>& rectangle2);
3368template <typename T>
3370template <typename T>
3372template <typename T>
3373inline T distance(const point2d<T>& point, const circle<T>& circle);
3374template <typename T>
3375inline T distance(const circle<T>& circle1, const circle<T>& circle2);
3376template <typename T>
3377inline T distance(const sphere<T>& sphere1, const sphere<T>& sphere2);
3378
3379template <typename T>
3380inline T lay_distance(const T& x1, const T& y1, const T& x2, const T& y2);
3381template <typename T>
3382inline T lay_distance(const T& x1, const T& y1, const T& z1, const T& x2,
3383 const T& y2, const T& z2);
3384template <typename T>
3385inline T lay_distance(const point2d<T>& point1, const point2d<T>& point2);
3386template <typename T>
3387inline T lay_distance(const point3d<T>& point1, const point3d<T>& point2);
3388template <typename T>
3389inline T lay_distance(const point2d<T>& point, const triangle<T, 2>& triangle);
3390template <typename T>
3391inline T lay_distance(const point2d<T>& point, const quadix<T, 2>& triangle);
3392template <typename T>
3393inline T lay_distance(const point2d<T>& point, const ray<T, 2>& ray);
3394template <typename T>
3395inline T lay_distance(const point3d<T>& point, const ray<T, 3>& ray);
3396template <typename T>
3397inline T lay_distance(const point3d<T>& point, const plane<T, 3>& plane);
3398template <typename T>
3399inline T lay_distance(const segment<T, 2>& segment1,
3400 const segment<T, 2>& segment2);
3401template <typename T>
3402inline T lay_distance(const segment<T, 3>& segment1,
3403 const segment<T, 3>& segment2);
3404template <typename T>
3405inline T lay_distance(const line<T, 3>& line1, const line<T, 3>& line2);
3406template <typename T>
3408template <typename T>
3410template <typename T>
3412 const triangle<T, 2>& triangle);
3413template <typename T>
3415 const triangle<T, 3>& triangle);
3416
3417template <typename T>
3418inline T manhattan_distance(const T& x1, const T& y1, const T& x2, const T& y2);
3419template <typename T>
3420inline T manhattan_distance(const T& x1, const T& y1, const T& z1, const T& x2,
3421 const T& y2, const T& z2);
3422template <typename T>
3423inline T manhattan_distance(const point2d<T>& point1, const point2d<T>& point2);
3424template <typename T>
3425inline T manhattan_distance(const point3d<T>& point1, const point3d<T>& point2);
3426template <typename T>
3427inline T manhattan_distance(const point2d<T>& point, const ray<T, 2>& ray);
3428template <typename T>
3429inline T manhattan_distance(const point3d<T>& point, const ray<T, 3>& ray);
3430template <typename T>
3432template <typename T>
3434template <typename T>
3435inline T manhattan_distance(const circle<T>& circle1, const circle<T>& circle2);
3436
3437template <typename T>
3438inline T chebyshev_distance(const T& x1, const T& y1, const T& x2, const T& y2);
3439template <typename T>
3440inline T chebyshev_distance(const T& x1, const T& y1, const T& z1, const T& x2,
3441 const T& y2, const T& z2);
3442template <typename T>
3443inline T chebyshev_distance(const point2d<T>& point1, const point2d<T>& point2);
3444template <typename T>
3445inline T chebyshev_distance(const point3d<T>& point1, const point3d<T>& point2);
3446template <typename T>
3448template <typename T>
3450template <typename T>
3451inline T chebyshev_distance(const circle<T>& circle1, const circle<T>& circle2);
3452
3453template <typename T>
3454inline T inverse_chebyshev_distance(const T& x1, const T& y1, const T& x2,
3455 const T& y2);
3456template <typename T>
3457inline T inverse_chebyshev_distance(const T& x1, const T& y1, const T& z1,
3458 const T& x2, const T& y2, const T& z2);
3459template <typename T>
3461 const point2d<T>& point2);
3462template <typename T>
3464 const point3d<T>& point2);
3465template <typename T>
3467template <typename T>
3469template <typename T>
3470inline T inverse_chebyshev_distance(const circle<T>& circle1,
3471 const circle<T>& circle2);
3472
3473template <typename T>
3475 const point2d<T>& point2);
3476template <typename T>
3477inline polygon<T, 2> minkowski_sum(const rectangle<T>& rectangle1,
3478 const rectangle<T>& rectangle2);
3479template <typename T>
3481 const triangle<T, 2>& triangle2);
3482template <typename T>
3484 const quadix<T, 2>& quadix2);
3485template <typename T>
3487 const circle<T>& circle);
3488
3489template <typename T>
3491 const rectangle<T>& rectangle);
3492template <typename T>
3494 const quadix<T, 2>& quadix);
3495template <typename T>
3497 const circle<T>& circle);
3498template <typename T>
3500 const circle<T>& circle);
3501template <typename T>
3503 const rectangle<T>& rectangle);
3504template <typename T>
3506 const circle<T>& circle);
3507template <typename T>
3509 const polygon<T, 2>& polygon2);
3510
3511template <typename T>
3513 const point2d<T>& point2);
3514template <typename T>
3516 const rectangle<T>& rectangle2);
3517template <typename T>
3519 const triangle<T, 2>& triangle2);
3520template <typename T>
3522 const quadix<T, 2>& quadix2);
3523template <typename T>
3525 const circle<T>& circle);
3526
3527template <typename T>
3529 const rectangle<T>& rectangle);
3530template <typename T>
3532 const quadix<T, 2>& quadix);
3533template <typename T>
3535 const circle<T>& circle);
3536template <typename T>
3538 const circle<T>& circle);
3539template <typename T>
3541 const rectangle<T>& rectangle);
3542template <typename T>
3544 const circle<T>& circle);
3545template <typename T>
3547 const polygon<T, 2>& polygon2);
3548
3549template <typename T>
3550inline 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
3554template <typename T>
3555inline 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
3560template <typename T>
3561inline 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
3565template <typename T>
3566inline 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
3571template <typename T>
3572inline 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
3576template <typename T>
3577inline 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
3582template <typename T>
3583inline 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
3587template <typename T>
3588inline 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
3593template <typename T>
3595 const circle<T>& circle);
3596
3597template <typename T>
3599 const sphere<T>& sphere);
3600
3601template <typename T>
3603 const circle<T>& circle);
3604
3605template <typename T>
3607 const sphere<T>& sphere);
3608
3609template <typename T>
3611
3612template <typename T>
3613inline T span_length(const box<T, 3>& box);
3614
3615template <typename T>
3616inline 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
3619template <typename T>
3620inline 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
3624template <typename T>
3625inline void project_point(const T& srcx, const T& srcy, const T& destx,
3626 const T& desty, const T& dist, T& nx, T& ny);
3627
3628template <typename T>
3629inline 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
3633template <typename T>
3634inline void project_point(const T& px, const T& py, const T& angle,
3635 const T& distance, T& nx, T& ny);
3636
3637template <typename T>
3638inline void project_point0(const T& px, const T& py, const T& distance, T& nx,
3639 T& ny);
3640template <typename T>
3641inline void project_point45(const T& px, const T& py, const T& distance, T& nx,
3642 T& ny);
3643template <typename T>
3644inline void project_point90(const T& px, const T& py, const T& distance, T& nx,
3645 T& ny);
3646template <typename T>
3647inline void project_point135(const T& px, const T& py, const T& distance, T& nx,
3648 T& ny);
3649template <typename T>
3650inline void project_point180(const T& px, const T& py, const T& distance, T& nx,
3651 T& ny);
3652template <typename T>
3653inline void project_point225(const T& px, const T& py, const T& distance, T& nx,
3654 T& ny);
3655template <typename T>
3656inline void project_point270(const T& px, const T& py, const T& distance, T& nx,
3657 T& ny);
3658template <typename T>
3659inline void project_point315(const T& px, const T& py, const T& distance, T& nx,
3660 T& ny);
3661
3662template <typename T>
3663inline point2d<T> project_point_t(const point2d<T>& source_point,
3664 const point2d<T>& destination_point,
3665 const T& t);
3666
3667template <typename T>
3668inline point3d<T> project_point_t(const point3d<T>& source_point,
3669 const point3d<T>& destination_point,
3670 const T& t);
3671
3672template <typename T>
3673inline point2d<T> project_point(const point2d<T>& source_point,
3674 const point2d<T>& destination_point,
3675 const T& distance);
3676
3677template <typename T>
3678inline point3d<T> project_point(const point3d<T>& source_point,
3679 const point3d<T>& destination_point,
3680 const T& distance);
3681
3682template <typename T>
3683inline point2d<T> project_point(const point2d<T>& point, const T& angle,
3684 const T& distance);
3685
3686template <typename T>
3687inline point2d<T> project_point0(const point2d<T>& point, const T& distance);
3688template <typename T>
3689inline point2d<T> project_point45(const point2d<T>& point, const T& distance);
3690template <typename T>
3691inline point2d<T> project_point90(const point2d<T>& point, const T& distance);
3692template <typename T>
3693inline point2d<T> project_point135(const point2d<T>& point, const T& distance);
3694template <typename T>
3695inline point2d<T> project_point180(const point2d<T>& point, const T& distance);
3696template <typename T>
3697inline point2d<T> project_point225(const point2d<T>& point, const T& distance);
3698template <typename T>
3699inline point2d<T> project_point270(const point2d<T>& point, const T& distance);
3700template <typename T>
3701inline point2d<T> project_point315(const point2d<T>& point, const T& distance);
3702
3703template <typename T>
3704inline point2d<T> project_object(const point2d<T>& point, const T& angle,
3705 const T& distance);
3706template <typename T>
3708 const T& angle, const T& distance);
3709template <typename T>
3711 const T& angle, const T& distance);
3712template <typename T>
3713inline quadix<T, 2> project_object(const quadix<T, 2>& quadix, const T& angle,
3714 const T& distance);
3715template <typename T>
3716inline circle<T> project_object(const circle<T>& circle, const T& angle,
3717 const T& distance);
3718template <typename T>
3720 const T& angle, const T& distance);
3721
3722template <typename T>
3724 const line<T, 2>& axis);
3725template <typename T>
3727 const line<T, 2>& axis);
3728template <typename T>
3730 const line<T, 2>& axis);
3731template <typename T>
3733 const line<T, 2>& axis);
3734template <typename T>
3736 const line<T, 2>& axis);
3737template <typename T>
3739 const line<T, 2>& axis);
3740
3741template <typename T>
3743 const line<T, 3>& axis);
3744template <typename T>
3746 const line<T, 3>& axis);
3747template <typename T>
3749 const line<T, 3>& axis);
3750template <typename T>
3752 const line<T, 3>& axis);
3753template <typename T>
3755 const line<T, 3>& axis);
3756template <typename T>
3758 const line<T, 3>& axis);
3759
3760template <typename T>
3762 T& ax, T& bx, T& ay, T& by);
3763template <typename T>
3765 T& ax, T& bx, T& ay, T& by, T& az,
3766 T& bz);
3767template <typename T>
3769 T& ax, T& bx, T& cx, T& ay, T& by,
3770 T& cy);
3771template <typename T>
3773 T& ax, T& bx, T& cx, T& ay, T& by,
3774 T& cy, T& az, T& bz, T& cz);
3775
3776template <typename T>
3778 const quadratic_bezier<T, 2>& bezier,
3780
3781template <typename T>
3783 const quadratic_bezier<T, 3>& bezier,
3785
3786template <typename T>
3788 const cubic_bezier<T, 2>& bezier,
3790
3791template <typename T>
3793 const cubic_bezier<T, 3>& bezier,
3795
3796template <typename T>
3798 const T& ax, const T& bx, const T& ay,
3799 const T& by, const T& t);
3800
3801template <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
3807template <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
3813template <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
3820template <typename T>
3822 const point2d<T>& start_point,
3823 const bezier_coefficients<T, 2, eQuadraticBezier>& coeffs, const T& t);
3824
3825template <typename T>
3827 const point3d<T>& start_point,
3828 const bezier_coefficients<T, 3, eQuadraticBezier>& coeffs, const T& t);
3829
3830template <typename T>
3832 const point2d<T>& start_point,
3833 const bezier_coefficients<T, 2, eCubicBezier>& coeffs, const T& t);
3834
3835template <typename T>
3837 const point3d<T>& start_point,
3838 const bezier_coefficients<T, 3, eCubicBezier>& coeffs, const T& t);
3839
3840template <typename T, typename OutputIterator>
3841inline void generate_bezier(const quadratic_bezier<T, 2>& bezier,
3842 OutputIterator out,
3843 const std::size_t& point_count = 1000);
3844template <typename T, typename OutputIterator>
3845inline void generate_bezier(const quadratic_bezier<T, 3>& bezier,
3846 OutputIterator out,
3847 const std::size_t& point_count = 1000);
3848template <typename T, typename OutputIterator>
3849inline void generate_bezier(const cubic_bezier<T, 2>& bezier,
3850 OutputIterator out,
3851 const std::size_t& point_count = 1000);
3852template <typename T, typename OutputIterator>
3853inline void generate_bezier(const cubic_bezier<T, 3>& bezier,
3854 OutputIterator out,
3855 const std::size_t& point_count = 1000);
3856
3857template <typename T>
3859 const std::size_t& point_count);
3860template <typename T>
3862 const std::size_t& point_count);
3863template <typename T>
3865 const std::size_t& point_count);
3866template <typename T>
3868 const std::size_t& point_count);
3869
3870template <typename T>
3872template <typename T>
3874
3875template <typename T>
3877 const T& x, const T& y);
3878template <typename T>
3880 const T& x, const T& y, const T& z);
3881template <typename T>
3883 const T& x, const T& y);
3884template <typename T>
3886 const T& x, const T& y);
3887template <typename T>
3888inline box<T, 3> center_at_location(const box<T, 3>& box, const T& x,
3889 const T& y, const T& z);
3890template <typename T>
3892 const T& y);
3893template <typename T>
3895 const T& y);
3896template <typename T>
3898 const T& x, const T& y);
3899
3900template <typename T>
3902 const point2d<T>& center_point);
3903template <typename T>
3905 const point3d<T>& center_point);
3906template <typename T>
3908 const point2d<T>& center_point);
3909template <typename T>
3911 const point2d<T>& center_point);
3912template <typename T>
3914 const point3d<T>& center_point);
3915template <typename T>
3917 const point2d<T>& center_point);
3918template <typename T>
3920 const point2d<T>& center_point);
3921template <typename T>
3923 const point2d<T>& center_point);
3924
3925template <typename T>
3926inline void shorten_segment(T& x1, T& y1, T& x2, T& y2, const T& amount);
3927template <typename T>
3928inline void shorten_segment(T& x1, T& y1, T& z1, T& x2, T& y2, T& z2,
3929 const T& amount);
3930template <typename T>
3932 const T& amount);
3933template <typename T>
3935 const T& amount);
3936
3937template <typename T>
3938inline void lengthen_segment(T& x1, T& y1, T& x2, T& y2, const T& amount);
3939template <typename T>
3940inline void lengthen_segment(T& x1, T& y1, T& z1, T& x2, T& y2, T& z2,
3941 const T& amount);
3942template <typename T>
3944 const T& amount);
3945template <typename T>
3947 const T& amount);
3948
3949template <typename T>
3950inline int out_code(const point2d<T>& point, const rectangle<T>& rectangle);
3951
3952template <typename T>
3953inline 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
3957template <typename T>
3958inline 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
3963template <typename T>
3964inline bool clip(const segment<T, 2>& src_segment,
3965 const rectangle<T>& rectangle, segment<T, 2>& csegment);
3966template <typename T>
3967inline bool clip(const segment<T, 2>& src_segment,
3968 const triangle<T, 2>& triangle, segment<T, 2>& csegment);
3969template <typename T>
3970inline bool clip(const segment<T, 2>& src_segment, const quadix<T, 2>& quadix,
3971 segment<T, 2>& csegment);
3972template <typename T>
3973inline bool clip(const segment<T, 2>& src_segment, const circle<T>& circle,
3974 segment<T, 2>& csegment);
3975template <typename T>
3976inline bool clip(const rectangle<T>& rectangle1, const rectangle<T>& rectangle2,
3977 rectangle<T>& crectangle);
3978template <typename T>
3979inline bool clip(const box<T, 3>& box1, const box<T, 3>& box2, box<T, 3>& cbox);
3980
3981template <typename T>
3982inline T area(const point2d<T>& point1, const point2d<T>& point2,
3983 const point2d<T>& point3);
3984template <typename T>
3985inline T area(const point3d<T>& point1, const point3d<T>& point2,
3986 const point3d<T>& point3);
3987template <typename T>
3988inline T area(const triangle<T, 2>& triangle);
3989template <typename T>
3990inline T area(const triangle<T, 3>& triangle);
3991template <typename T>
3992inline T area(const quadix<T, 2>& quadix);
3993template <typename T>
3994inline T area(const quadix<T, 3>& quadix);
3995template <typename T>
3996inline T area(const rectangle<T>& rectangle);
3997template <typename T>
3998inline T area(const circle<T>& circle);
3999template <typename T>
4000inline T area(const polygon<T, 2>& polygon);
4001
4002template <typename T>
4003inline T perimeter(const point2d<T>& point1, const point2d<T>& point2,
4004 const point2d<T>& point3);
4005template <typename T>
4006inline T perimeter(const point3d<T>& point1, const point3d<T>& point2,
4007 const point3d<T>& point3);
4008template <typename T>
4010template <typename T>
4012template <typename T>
4014template <typename T>
4016template <typename T>
4018template <typename T>
4019inline T perimeter(const circle<T>& circle);
4020template <typename T>
4022
4023template <typename T>
4024inline void rotate(const T& rotation_angle, const T& x, const T& y, T& nx,
4025 T& ny);
4026template <typename T>
4027inline void rotate(const T& rotation_angle, const T& x, const T& y, const T& ox,
4028 const T& oy, T& nx, T& ny);
4029
4030template <typename T>
4031inline point2d<T> rotate(const T& rotation_angle, const point2d<T>& point);
4032template <typename T>
4033inline point2d<T> rotate(const T& rotation_angle, const point2d<T>& point,
4034 const point2d<T>& opoint);
4035
4036template <typename T>
4037inline segment<T, 2> rotate(const T& rotation_angle,
4038 const segment<T, 2>& segment);
4039template <typename T>
4040inline segment<T, 2> rotate(const T& rotation_angle,
4041 const segment<T, 2>& segment,
4042 const point2d<T>& opoint);
4043
4044template <typename T>
4045inline triangle<T, 2> rotate(const T& rotation_angle,
4046 const triangle<T, 2>& triangle);
4047template <typename T>
4048inline triangle<T, 2> rotate(const T& rotation_angle,
4050 const point2d<T>& opoint);
4051
4052template <typename T>
4053inline quadix<T, 2> rotate(const T& rotation_angle, const quadix<T, 2>& quadix);
4054template <typename T>
4055inline quadix<T, 2> rotate(const T& rotation_angle, const quadix<T, 2>& quadix,
4056 const point2d<T>& opoint);
4057
4058template <typename T>
4059inline polygon<T, 2> rotate(const T& rotation_angle,
4060 const polygon<T, 2>& polygon);
4061template <typename T>
4062inline polygon<T, 2> rotate(const T& rotation_angle,
4063 const polygon<T, 2>& polygon,
4064 const point2d<T>& opoint);
4065
4066template <typename T>
4067inline void fast_rotate(const trig_luts<T>& lut, const int rotation_angle,
4068 const T& x, const T& y, T& nx, T& ny);
4069
4070template <typename T>
4071inline 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
4075template <typename T>
4076inline point2d<T> fast_rotate(const trig_luts<T>& lut, const int rotation_angle,
4077 const point2d<T>& point);
4078template <typename T>
4079inline point2d<T> fast_rotate(const trig_luts<T>& lut, const int rotation_angle,
4080 const point2d<T>& point,
4081 const point2d<T>& opoint);
4082
4083template <typename T>
4085 const int rotation_angle,
4086 const segment<T, 2>& segment);
4087template <typename T>
4089 const int rotation_angle,
4090 const segment<T, 2>& segment,
4091 const point2d<T>& opoint);
4092
4093template <typename T>
4095 const int rotation_angle,
4096 const triangle<T, 2>& triangle);
4097template <typename T>
4099 const int rotation_angle,
4101 const point2d<T>& opoint);
4102
4103template <typename T>
4105 const int rotation_angle,
4106 const quadix<T, 2>& quadix);
4107template <typename T>
4109 const int rotation_angle,
4110 const quadix<T, 2>& quadix,
4111 const point2d<T>& opoint);
4112
4113template <typename T>
4115 const int rotation_angle,
4116 const polygon<T, 2>& polygon);
4117template <typename T>
4119 const int rotation_angle,
4120 const polygon<T, 2>& polygon,
4121 const point2d<T>& opoint);
4122
4123template <typename T>
4124inline 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
4128template <typename T>
4129inline 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
4134template <typename T>
4135inline point3d<T> fast_rotate(const trig_luts<T>& lut, const int rx,
4136 const int ry, const int rz,
4137 const point3d<T>& point);
4138template <typename T>
4139inline 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
4144template <typename T>
4145inline 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);
4148template <typename T>
4149inline 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
4154template <typename T>
4155inline 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);
4158template <typename T>
4159inline triangle<T, 3> fast_rotate(const trig_luts<T>& lut, const int rx,
4160 const int ry, const int rz,
4162 const point3d<T>& opoint);
4163
4164template <typename T>
4165inline 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);
4168template <typename T>
4169inline 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
4174template <typename T>
4175inline 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);
4178template <typename T>
4179inline 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
4184template <typename T>
4185inline point2d<T> translate(const T& dx, const T& dy, const point2d<T>& point);
4186template <typename T>
4187inline line<T, 2> translate(const T& dx, const T& dy, const line<T, 2>& line);
4188template <typename T>
4189inline segment<T, 2> translate(const T& dx, const T& dy,
4190 const segment<T, 2>& segment);
4191template <typename T>
4192inline triangle<T, 2> translate(const T& dx, const T& dy,
4193 const triangle<T, 2>& triangle);
4194template <typename T>
4195inline quadix<T, 2> translate(const T& dx, const T& dy,
4196 const quadix<T, 2>& quadix);
4197template <typename T>
4198inline rectangle<T> translate(const T& dx, const T& dy,
4199 const rectangle<T>& rectangle);
4200template <typename T>
4201inline circle<T> translate(const T& dx, const T& dy, const circle<T>& circle);
4202template <typename T>
4203inline polygon<T, 2> translate(const T& dx, const T& dy,
4204 const polygon<T, 2>& polygon);
4205
4206template <typename T>
4207inline point2d<T> translate(const T& delta, const point2d<T>& point);
4208template <typename T>
4209inline line<T, 2> translate(const T& delta, const line<T, 2>& line);
4210template <typename T>
4211inline segment<T, 2> translate(const T& delta, const segment<T, 2>& segment);
4212template <typename T>
4213inline triangle<T, 2> translate(const T& delta, const triangle<T, 2>& triangle);
4214template <typename T>
4215inline quadix<T, 2> translate(const T& delta, const quadix<T, 2>& quadix);
4216template <typename T>
4217inline rectangle<T> translate(const T& delta, const rectangle<T>& rectangle);
4218template <typename T>
4219inline circle<T> translate(const T& delta, const circle<T>& circle);
4220template <typename T>
4221inline polygon<T, 2> translate(const T& delta, const polygon<T, 2>& polygon);
4222
4223template <typename T>
4224inline point2d<T> translate(const vector2d<T>& v, const point2d<T>& point);
4225template <typename T>
4227template <typename T>
4229 const segment<T, 2>& segment);
4230template <typename T>
4232 const triangle<T, 2>& triangle);
4233template <typename T>
4235template <typename T>
4237 const rectangle<T>& rectangle);
4238template <typename T>
4240template <typename T>
4242 const polygon<T, 2>& polygon);
4243
4244template <typename T>
4245inline point3d<T> translate(const T& dx, const T& dy, const T& dz,
4246 const point3d<T>& point);
4247template <typename T>
4248inline line<T, 3> translate(const T& dx, const T& dy, const T& dz,
4249 const line<T, 3>& line);
4250template <typename T>
4251inline segment<T, 3> translate(const T& dx, const T& dy, const T& dz,
4252 const segment<T, 3>& segment);
4253template <typename T>
4254inline triangle<T, 3> translate(const T& dx, const T& dy, const T& dz,
4255 const triangle<T, 3>& triangle);
4256template <typename T>
4257inline quadix<T, 3> translate(const T& dx, const T& dy, const T& dz,
4258 const quadix<T, 3>& quadix);
4259template <typename T>
4260inline box<T, 3> translate(const T& dx, const T& dy, const T& dz,
4261 const box<T, 3>& box);
4262template <typename T>
4263inline sphere<T> translate(const T& dx, const T& dy, const T& dz,
4264 const sphere<T>& sphere);
4265template <typename T>
4266inline polygon<T, 3> translate(const T& dx, const T& dy, const T& dz,
4267 const polygon<T, 3>& polygon);
4268
4269template <typename T>
4270inline point3d<T> translate(const T& delta, const point3d<T>& point);
4271template <typename T>
4272inline line<T, 3> translate(const T& delta, const line<T, 3>& line);
4273template <typename T>
4274inline segment<T, 3> translate(const T& delta, const segment<T, 3>& segment);
4275template <typename T>
4276inline triangle<T, 3> translate(const T& delta, const triangle<T, 3>& triangle);
4277template <typename T>
4278inline quadix<T, 3> translate(const T& delta, const quadix<T, 3>& quadix);
4279template <typename T>
4280inline box<T, 3> translate(const T& delta, const box<T, 3>& box);
4281template <typename T>
4282inline sphere<T> translate(const T& delta, const sphere<T>& sphere);
4283template <typename T>
4284inline polygon<T, 3> translate(const T& delta, const polygon<T, 3>& polygon);
4285
4286template <typename T>
4287inline point3d<T> translate(const vector3d<T>& v, const point3d<T>& point);
4288template <typename T>
4290template <typename T>
4292 const segment<T, 3>& segment);
4293template <typename T>
4295 const triangle<T, 3>& triangle);
4296template <typename T>
4298template <typename T>
4299inline box<T, 3> translate(const vector3d<T>& v, const box<T, 3>& box);
4300template <typename T>
4302template <typename T>
4304 const polygon<T, 3>& polygon);
4305
4306template <typename T>
4307inline point2d<T> scale(const T& dx, const T& dy, const point2d<T>& point);
4308template <typename T>
4309inline line<T, 2> scale(const T& dx, const T& dy, const line<T, 2>& line);
4310template <typename T>
4311inline segment<T, 2> scale(const T& dx, const T& dy,
4312 const segment<T, 2>& segment);
4313template <typename T>
4314inline triangle<T, 2> scale(const T& dx, const T& dy,
4315 const triangle<T, 2>& triangle);
4316template <typename T>
4317inline quadix<T, 2> scale(const T& dx, const T& dy, const quadix<T, 2>& quadix);
4318template <typename T>
4319inline rectangle<T> scale(const T& dx, const T& dy,
4320 const rectangle<T>& rectangle);
4321template <typename T>
4322inline circle<T> scale(const T& dr, const circle<T>& circle);
4323template <typename T>
4324inline polygon<T, 2> scale(const T& dx, const T& dy,
4325 const polygon<T, 2>& polygon);
4326
4327template <typename T>
4328inline point3d<T> scale(const T& dx, const T& dy, const T& dz,
4329 const point3d<T>& point);
4330template <typename T>
4331inline line<T, 3> scale(const T& dx, const T& dy, const T& dz,
4332 const line<T, 3>& line);
4333template <typename T>
4334inline segment<T, 3> scale(const T& dx, const T& dy, const T& dz,
4335 const segment<T, 3>& segment);
4336template <typename T>
4337inline triangle<T, 3> scale(const T& dx, const T& dy, const T& dz,
4338 const triangle<T, 3>& triangle);
4339template <typename T>
4340inline quadix<T, 3> scale(const T& dx, const T& dy, const T& dz,
4341 const quadix<T, 3>& quadix);
4342template <typename T>
4343inline box<T, 3> scale(const T& dx, const T& dy, const T& dz,
4344 const box<T, 3>& box);
4345template <typename T>
4346inline sphere<T> scale(const T& dr, const sphere<T>& sphere);
4347template <typename T>
4348inline polygon<T, 3> scale(const T& dx, const T& dy, const T& dz,
4349 const polygon<T, 3>& polygon);
4350
4351template <typename T>
4353template <typename T>
4355template <typename T>
4357template <typename T>
4359template <typename T>
4361template <typename T>
4363
4364template <typename T>
4365inline void aabb(const segment<T, 2>& segment, T& x1, T& y1, T& x2, T& y2);
4366template <typename T>
4367inline void aabb(const triangle<T, 2>& triangle, T& x1, T& y1, T& x2, T& y2);
4368template <typename T>
4369inline void aabb(const rectangle<T>& rectangle, T& x1, T& y1, T& x2, T& y2);
4370template <typename T>
4371inline void aabb(const quadix<T, 2>& quadix, T& x1, T& y1, T& x2, T& y2);
4372template <typename T>
4373inline void aabb(const circle<T>& circle, T& x1, T& y1, T& x2, T& y2);
4374template <typename T>
4375inline void aabb(const polygon<T, 2>& polygon, T& x1, T& y1, T& x2, T& y2);
4376
4377template <typename T>
4379template <typename T>
4381template <typename T>
4383template <typename T>
4385template <typename T>
4387template <typename T>
4389
4390template <typename T>
4391inline void aabb(const segment<T, 3>& segment, T& x1, T& y1, T& z1, T& x2,
4392 T& y2, T& z2);
4393template <typename T>
4394inline void aabb(const triangle<T, 3>& triangle, T& x1, T& y1, T& z1, T& x2,
4395 T& y2, T& z2);
4396template <typename T>
4397inline void aabb(const box<T, 3>& box, T& x1, T& y1, T& z1, T& x2, T& y2,
4398 T& z2);
4399template <typename T>
4400inline void aabb(const quadix<T, 3>& quadix, T& x1, T& y1, T& z1, T& x2, T& y2,
4401 T& z2);
4402template <typename T>
4403inline void aabb(const sphere<T>& sphere, T& x1, T& y1, T& z1, T& x2, T& y2,
4404 T& z2);
4405template <typename T>
4406inline void aabb(const polygon<T, 3>& polygon, T& x1, T& y1, T& z1, T& x2,
4407 T& y2, T& z2);
4408
4409template <typename T>
4411 point2d<T>& point);
4412template <typename T>
4414template <typename T>
4416template <typename T>
4418
4419template <typename T>
4421 const T& t);
4422template <typename T>
4424 const T& t);
4425template <typename T>
4427template <typename T>
4429
4430template <typename T>
4431inline T generate_random_value(const T& range);
4432
4433template <typename T>
4434inline point2d<T> generate_random_point(const T& dx, const T& dy);
4435template <typename T>
4436inline point3d<T> generate_random_point(const T& dx, const T& dy, const T& dz);
4437template <typename T>
4439template <typename T>
4441template <typename T>
4443template <typename T>
4445template <typename T>
4447template <typename T>
4449template <typename T>
4451template <typename T>
4453
4454template <typename T, typename OutputIterator>
4455inline 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);
4458template <typename T, typename OutputIterator>
4459inline 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);
4463template <typename T, typename OutputIterator>
4465 const std::size_t& point_count,
4466 OutputIterator out);
4467template <typename T, typename OutputIterator>
4469 const std::size_t& point_count,
4470 OutputIterator out);
4471template <typename T, typename OutputIterator>
4473 const std::size_t& point_count,
4474 OutputIterator out);
4475template <typename T, typename OutputIterator>
4477 const std::size_t& point_count,
4478 OutputIterator out);
4479template <typename T, typename OutputIterator>
4481 const std::size_t& point_count,
4482 OutputIterator out);
4483template <typename T, typename OutputIterator>
4485 const std::size_t& point_count,
4486 OutputIterator out);
4487template <typename T, typename OutputIterator>
4489 const std::size_t& point_count,
4490 OutputIterator out);
4491template <typename T, typename OutputIterator>
4493 const std::size_t& point_count,
4494 OutputIterator out);
4495template <typename T, typename OutputIterator>
4497 const std::size_t& point_count,
4498 OutputIterator out);
4499
4500template <typename T>
4501inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4502 const T& y2, segment<T, 2>& segment);
4503template <typename T>
4504inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4505 const T& y2, rectangle<T>& rectangle);
4506template <typename T>
4507inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4508 const T& y2, triangle<T, 2>& triangle);
4509template <typename T>
4510inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4511 const T& y2, quadix<T, 2>& quadix);
4512template <typename T>
4513inline void generate_random_object(const T& x1, const T& y1, const T& x2,
4514 const T& y2, circle<T>& circle);
4515template <typename T>
4516inline 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
4520template <typename T>
4522 const std::size_t& shift);
4523
4524template <typename T>
4526 const std::size_t& shift);
4527
4528template <typename T>
4530 const std::size_t& shift);
4531
4532template <typename T>
4534 const std::size_t& shift);
4535
4536template <typename T>
4537inline T vector_norm(const vector2d<T>& v);
4538template <typename T>
4539inline T vector_norm(const vector3d<T>& v);
4540
4541template <typename T>
4543template <typename T>
4545
4546template <typename T>
4548template <typename T>
4550
4551template <typename T>
4552inline vector2d<T> operator+(const vector2d<T>& v1, const vector2d<T>& v2);
4553template <typename T>
4554inline vector3d<T> operator+(const vector3d<T>& v1, const vector3d<T>& v2);
4555
4556template <typename T>
4557inline vector2d<T> operator-(const vector2d<T>& v1, const vector2d<T>& v2);
4558template <typename T>
4559inline vector3d<T> operator-(const vector3d<T>& v1, const vector3d<T>& v2);
4560
4561template <typename T>
4562inline T operator*(const vector2d<T>& v1, const vector2d<T>& v2);
4563template <typename T>
4564inline vector3d<T> operator*(const vector3d<T>& v1, const vector3d<T>& v2);
4565
4566template <typename T>
4567inline T dot_product(const vector2d<T>& v1, const vector2d<T>& v2);
4568template <typename T>
4569inline T dot_product(const vector3d<T>& v1, const vector3d<T>& v2);
4570
4571template <typename T>
4572inline T perpendicular_product(const vector2d<T>& v1, const vector2d<T>& v2);
4573template <typename T>
4574inline T triple_product(const vector3d<T>& v1, const vector3d<T>& v2,
4575 const vector3d<T>& v3);
4576
4577template <typename T>
4578inline vector2d<T> operator*(const vector2d<T>& v1, const T& scale);
4579template <typename T>
4580inline vector3d<T> operator*(const vector3d<T>& v1, const T& scale);
4581template <typename T>
4582inline vector2d<T> operator*(const T& scale, const vector2d<T>& v1);
4583template <typename T>
4584inline vector3d<T> operator*(const T& scale, const vector3d<T>& v1);
4585
4586template <typename T>
4587inline vector2d<T> operator/(const vector2d<T>& v1, const T& scale);
4588template <typename T>
4589inline vector3d<T> operator/(const vector3d<T>& v1, const T& scale);
4590
4591template <typename T>
4592inline point2d<T> operator*(const point2d<T>& point, const T& scale);
4593template <typename T>
4594inline point3d<T> operator*(const point3d<T>& point, const T& scale);
4595template <typename T>
4596inline point2d<T> operator*(const T& scale, const point2d<T>& point);
4597template <typename T>
4598inline point3d<T> operator*(const T& scale, const point3d<T>& point);
4599
4600template <typename T>
4601inline point2d<T> operator+(const point2d<T>& point, const vector2d<T>& v);
4602template <typename T>
4603inline point2d<T> operator+(const vector2d<T>& v, const point2d<T>& point);
4604
4605template <typename T>
4606inline point3d<T> operator+(const point3d<T>& point, const vector3d<T>& v);
4607template <typename T>
4608inline point3d<T> operator+(const vector3d<T>& v, const point3d<T>& point);
4609
4610template <typename T>
4611inline vector2d<T> operator-(const point2d<T>& p1, const point2d<T>& p2);
4612template <typename T>
4613inline vector3d<T> operator-(const point3d<T>& p1, const point3d<T>& p2);
4614
4615template <typename T>
4616inline point2d<T> operator+(const point2d<T>& p1, const point2d<T>& p2);
4617template <typename T>
4618inline point3d<T> operator+(const point3d<T>& p1, const point3d<T>& p2);
4619
4620template <typename T>
4621inline bool is_equal(const T& val1, const T& val2, const T& epsilon);
4622template <typename T>
4623inline bool is_equal(const point2d<T>& point1, const point2d<T>& point2,
4624 const T& epsilon);
4625template <typename T>
4626inline bool is_equal(const point3d<T>& point1, const point3d<T>& point2,
4627 const T& epsilon);
4628
4629template <typename T>
4630inline bool is_equal(const T& val1, const T& val2);
4631template <typename T>
4632inline bool is_equal(const point2d<T>& point1, const point2d<T>& point2);
4633template <typename T>
4634inline bool is_equal(const point3d<T>& point1, const point3d<T>& point2);
4635
4636template <typename T>
4637inline bool is_equal(const rectangle<T>& rectangle1,
4638 const rectangle<T>& rectangle2);
4639template <typename T>
4640inline bool is_equal(const circle<T>& circle1, const circle<T>& circle2);
4641
4642template <typename T>
4643inline bool is_equal(const box<T, 3>& box1, const box<T, 3>& box2);
4644template <typename T>
4645inline bool is_equal(const sphere<T>& sphere1, const sphere<T>& sphere2);
4646
4647template <typename T>
4648inline bool not_equal(const T& val1, const T& val2, const T& epsilon);
4649template <typename T>
4650inline bool not_equal(const point2d<T>& point1, const point2d<T>& point2,
4651 const T& epsilon);
4652template <typename T>
4653inline bool not_equal(const point3d<T>& point1, const point3d<T>& point2,
4654 const T& epsilon);
4655
4656template <typename T>
4657inline bool not_equal(const T& val1, const T& val2);
4658template <typename T>
4659inline bool not_equal(const point2d<T>& point1, const point2d<T>& point2);
4660template <typename T>
4661inline bool not_equal(const point3d<T>& point1, const point3d<T>& point2);
4662
4663template <typename T>
4664inline bool not_equal(const rectangle<T>& rectangle1,
4665 const rectangle<T>& rectangle2);
4666template <typename T>
4667inline bool not_equal(const circle<T>& circle1, const circle<T>& circle2);
4668
4669template <typename T>
4670inline bool not_equal(const box<T, 3>& box1, const box<T, 3>& box2);
4671template <typename T>
4672inline bool not_equal(const sphere<T>& sphere1, const sphere<T>& sphere2);
4673
4674template <typename T>
4675inline bool less_than_or_equal(const T& val1, const T& val2, const T& epsilon);
4676template <typename T>
4677inline bool less_than_or_equal(const T& val1, const T& val2);
4678
4679template <typename T>
4680inline bool greater_than_or_equal(const T& val1, const T& val2,
4681 const T& epsilon);
4682template <typename T>
4683inline bool greater_than_or_equal(const T& val1, const T& val2);
4684
4685template <typename T>
4686inline bool operator<(const point2d<T>& point1, const point2d<T>& point2);
4687template <typename T>
4688inline bool operator<(const point3d<T>& point1, const point3d<T>& point2);
4689template <typename T>
4690inline bool operator>(const point2d<T>& point1, const point2d<T>& point2);
4691template <typename T>
4692inline bool operator>(const point3d<T>& point1, const point3d<T>& point2);
4693
4694template <typename T>
4695inline bool operator==(const point2d<T>& point1, const point2d<T>& point2);
4696template <typename T>
4697inline bool operator==(const point3d<T>& point1, const point3d<T>& point2);
4698
4699template <typename T>
4700inline bool is_degenerate(const T& x1, const T& y1, const T& x2, const T& y2);
4701template <typename T>
4703template <typename T>
4704inline bool is_degenerate(const line<T, 2>& line);
4705
4706template <typename T>
4707inline bool is_degenerate(const T& x1, const T& y1, const T& z1, const T& x2,
4708 const T& y2, const T& z2);
4709template <typename T>
4711template <typename T>
4712inline bool is_degenerate(const line<T, 3>& line);
4713
4714template <typename T>
4716template <typename T>
4718
4719template <typename T>
4721template <typename T>
4723
4724template <typename T>
4726template <typename T>
4727inline bool is_degenerate(const circle<T>& circle);
4728template <typename T>
4729inline bool is_degenerate(const sphere<T>& sphere);
4730template <typename T>
4731inline bool is_degenerate(const circular_arc<T>& arc);
4732
4733template <typename T>
4735template <typename T>
4737template <typename T>
4739template <typename T>
4741template <typename T>
4743template <typename T>
4745template <typename T>
4747template <typename T>
4749template <typename T>
4751template <typename T>
4753template <typename T>
4755template <typename T>
4757template <typename T>
4759template <typename T>
4761template <typename T>
4763template <typename T>
4765template <typename T>
4767
4768template <typename T>
4770template <typename T>
4772template <typename T>
4774template <typename T>
4776
4777template <typename T>
4778inline void swap(point2d<T>& point1, point2d<T>& point2);
4779template <typename T>
4780inline void swap(point3d<T>& point1, point3d<T>& point2);
4781
4782template <typename T>
4783inline point2d<T> make_point(const T& x, const T& y);
4784template <typename T>
4785inline point3d<T> make_point(const T& x, const T& y, const T& z);
4786
4787template <typename T>
4788inline point2d<T> make_point(const point3d<T> point);
4789template <typename T>
4790inline point3d<T> make_point(const point2d<T> point, const T& z = T(0.0));
4791
4792template <typename T>
4794template <typename T>
4796
4797template <typename T>
4798inline vector2d<T> make_vector(const T& x, const T& y);
4799template <typename T>
4800inline vector3d<T> make_vector(const T& x, const T& y, const T& z);
4801
4802template <typename T>
4804template <typename T>
4805inline vector3d<T> make_vector(const vector2d<T> v, const T& z = T(0.0));
4806
4807template <typename T>
4809template <typename T>
4811
4812template <typename T>
4813inline ray<T, 2> make_ray(const T& ox, const T& oy, const T& dir_x,
4814 const T& dir_y);
4815template <typename T>
4816inline 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
4819template <typename T>
4820inline ray<T, 2> make_ray(const point2d<T>& origin,
4821 const vector2d<T>& direction);
4822template <typename T>
4823inline ray<T, 3> make_ray(const point3d<T>& origin,
4824 const vector3d<T>& direction);
4825
4826template <typename T>
4827inline ray<T, 2> make_ray(const point2d<T>& origin, const T& bearing);
4828
4829template <typename T>
4830inline curve_point<T, 2> make_curve_point(const T& x, const T& y, const T& t);
4831template <typename T>
4832inline curve_point<T, 3> make_curve_point(const T& x, const T& y, const T& z,
4833 const T& t);
4834
4835template <typename T>
4836inline curve_point<T, 2> make_curve_point(const point2d<T>& point, const T& t);
4837template <typename T>
4838inline curve_point<T, 3> make_curve_point(const point3d<T>& point, const T& t);
4839
4840template <typename T>
4841inline segment<T, 2> make_segment(const T& x1, const T& y1, const T& x2,
4842 const T& y2);
4843template <typename T>
4844inline 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
4847template <typename T>
4849 const point2d<T>& point2);
4850template <typename T>
4852 const point3d<T>& point2);
4853
4854template <typename T>
4856template <typename T>
4858
4859template <typename T>
4860inline line<T, 2> make_line(const T& x1, const T& y1, const T& x2, const T& y2);
4861template <typename T>
4862inline 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
4865template <typename T>
4866inline line<T, 2> make_line(const point2d<T>& point1, const point2d<T>& point2);
4867template <typename T>
4868inline line<T, 3> make_line(const point3d<T>& point1, const point3d<T>& point2);
4869
4870template <typename T>
4872template <typename T>
4874
4875template <typename T>
4877template <typename T>
4879
4880template <typename T>
4881inline rectangle<T> make_rectangle(const T& x1, const T& y1, const T& x2,
4882 const T& y2);
4883template <typename T>
4885 const point2d<T>& point2);
4886
4887template <typename T>
4888inline box<T, 3> make_box(const T& x1, const T& y1, const T& z1, const T& x2,
4889 const T& y2, const T& z2);
4890template <typename T>
4891inline box<T, 3> make_box(const point3d<T>& point1, const point3d<T>& point2);
4892
4893template <typename T>
4894inline 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
4897template <typename T>
4898inline 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
4902template <typename T>
4904 const point2d<T>& point2,
4905 const point2d<T>& point3);
4906template <typename T>
4908 const point3d<T>& point2,
4909 const point3d<T>& point3);
4910
4911template <typename T>
4912inline 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
4916template <typename T>
4917inline 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
4922template <typename T>
4924 const point2d<T>& point2,
4925 const point2d<T>& point3,
4926 const point2d<T>& point4);
4927template <typename T>
4929 const point3d<T>& point2,
4930 const point3d<T>& point3,
4931 const point3d<T>& point4);
4932
4933template <typename T>
4934inline quadix<T, 2> make_quadix(const T& x1, const T& y1, const T& x2,
4935 const T& y2);
4936template <typename T>
4938
4939template <typename T>
4940inline circle<T> make_circle(const T& x, const T& y, const T& radius);
4941template <typename T>
4942inline circle<T> make_circle(const point2d<T>& point, const T& radius);
4943template <typename T>
4944inline circle<T> make_circle(const point2d<T>& point1,
4945 const point2d<T>& point2);
4946template <typename T>
4947inline circle<T> make_circle(const point2d<T>& point1, const point2d<T>& point2,
4948 const point2d<T>& point3);
4949template <typename T>
4951
4952template <typename T>
4953inline sphere<T> make_sphere(const T& x, const T& y, const T& z,
4954 const T& radius);
4955template <typename T>
4956inline sphere<T> make_sphere(const point3d<T>& point, const T& radius);
4957template <typename T>
4958inline sphere<T> make_sphere(const point3d<T>& point1,
4959 const point3d<T>& point2);
4960
4961template <typename T>
4962inline 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
4966template <typename T>
4967inline 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
4970template <typename T>
4971inline plane<T, 3> make_plane(const point3d<T>& point1,
4972 const point3d<T>& point2,
4973 const point3d<T>& point3);
4974template <typename T>
4976 const vector3d<T>& normal);
4977template <typename T>
4979
4980template <typename T, std::size_t D, typename InputIterator>
4981inline polygon<T, D> make_polygon(const InputIterator begin,
4982 const InputIterator end);
4983
4984template <typename T>
4985inline polygon<T, 2> make_polygon(const std::vector<point2d<T> >& point_list);
4986template <typename T>
4987inline polygon<T, 3> make_polygon(const std::vector<point3d<T> >& point_list);
4988
4989template <typename T>
4991template <typename T>
4993template <typename T>
4995template <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
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:709
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
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
std::size_t size() const
Definition wykobi.hpp:571
T t
Definition wykobi.hpp:573
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:561
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
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:442
PointType center
Definition wykobi.hpp:446
const PointType & const_reference
Definition wykobi.hpp:443
T radius
Definition wykobi.hpp:447
Definition wykobi.hpp:287
PointType & reference
Definition wykobi.hpp:296
const PointType & const_reference
Definition wykobi.hpp:295
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:294
line()
Definition wykobi.hpp:291
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
plane()
Definition wykobi.hpp:690
define_vector_type< T, Dimension >::VectorType VectorType
Definition wykobi.hpp:694
Definition wykobi.hpp:74
reference operator()(const std::size_t &index)
Definition wykobi.hpp:90
T x
Definition wykobi.hpp:104
point2d< T > & operator=(const pointnd< T, 2 > &point)
Definition wykobi.hpp:84
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
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
reference operator()(const std::size_t &index)
Definition wykobi.hpp:125
Type & reference
Definition wykobi.hpp:112
point3d< T > & operator=(const pointnd< T, 3 > &point)
Definition wykobi.hpp:118
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(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 pointnd< T, D > &point)
Definition wykobi.hpp:206
pointnd< T, D > & operator=(const point2d< T > &point)
Definition wykobi.hpp:212
pointnd< T, D > & operator=(const point3d< T > &point)
Definition wykobi.hpp:220
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(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
define_point_type< double, Dimension >::PointType PointType
Definition wykobi.hpp:388
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
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
~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
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:476
const_reference operator[](const std::size_t &index) const
Definition wykobi.hpp:485
Definition wykobi.hpp:674
VectorType direction
Definition wykobi.hpp:683
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:679
ray()
Definition wykobi.hpp:676
PointType origin
Definition wykobi.hpp:682
~ray()
Definition wykobi.hpp:677
define_vector_type< T, Dimension >::VectorType VectorType
Definition wykobi.hpp:680
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
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
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:270
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
PointType & reference
Definition wykobi.hpp:320
triangle()
Definition wykobi.hpp:315
reference operator[](const std::size_t &index)
Definition wykobi.hpp:326
define_point_type< T, Dimension >::PointType PointType
Definition wykobi.hpp:318
~triangle()
Definition wykobi.hpp:316
Definition wykobi.hpp:757
static const unsigned int TableSize
Definition wykobi.hpp:759
const T & sin(const unsigned int angle) const
Definition wykobi.hpp:769
const T & tan(const unsigned int angle) const
Definition wykobi.hpp:771
trig_luts()
Definition wykobi.hpp:761
const T & cos(const unsigned int angle) const
Definition wykobi.hpp:770
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(const T &_x=T(0.0), const T &_y=T(0.0), const T &_z=T(0.0))
Definition wykobi.hpp:599
vector3d< T > & operator=(const vectornd< T, 3 > &vec)
Definition wykobi.hpp:605
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
T manhattan_distance(const T &x1, const T &y1, const T &x2, const T &y2)
rectangle< T > degenerate_rectangle()
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)
triangle< T, 2 > create_morley_triangle(const triangle< T, 2 > &triangle)
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)
sphere< T > make_sphere(const T &x, const T &y, const T &z, const T &radius)
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)
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))
point2d< T > generate_point_on_ray(const ray< T, 2 > &ray, const T &t)
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)
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)
vector2d< T > normalize(const vector2d< T > &v)
T robust_cartesian_angle(const T &x, const T &y)
rectangle< T > update_rectangle(const rectangle< T > &rectangle, point2d< T > &point)
line< T, 2 > triangle_symmedian(const triangle< T, 2 > &triangle, const std::size_t &symmedian)
triangle< T, 2 > create_first_brocard_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)
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)
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)
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)
point2d< T > closest_point_on_circle_from_segment(const circle< T > &circle, const segment< T, 2 > &segment)
T distance_from_point_to_sphere_center(const point3d< T > &point, const sphere< T > &sphere)
triangle< T, 2 > create_anticevian_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
circle< T > brocard_circle(const triangle< T, 2 > &triangle)
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)
triangle< T, 2 > create_incentral_triangle(const triangle< T, 2 > &triangle)
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
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)
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)
T perpendicular_product(const vector2d< T > &v1, const vector2d< T > &v2)
bool is_isosceles_triangle(const triangle< T, 2 > &triangle)
triangle< T, 2 > create_anticomplementary_triangle(const triangle< T, 2 > &triangle)
triangle< T, 2 > create_contact_triangle(const triangle< T, 2 > &triangle)
point2d< T > antipodal_point(const point2d< T > &point, const circle< T > &circle)
double epsilon< double >()
Definition wykobi.hpp:793
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 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)
circle< T > mandart_circle(const triangle< T, 2 > &triangle)
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)
triangle< T, 2 > create_medial_triangle(const triangle< T, 2 > &triangle)
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)
line< T, 2 > perspectrix(const triangle< T, 2 > &triangle1, const triangle< T, 2 > &triangle2)
circle< T > invert_circle_across_circle(const circle< T > &circle1, const circle< T > &circle2)
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))
segment< T, 2 > reverse_segment(const segment< T, 2 > &segment)
bool less_than_or_equal(const T &val1, const T &val2, const T &epsilon)
T horizontal_mirror(const T &angle)
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)
triangle< T, 2 > create_circummedial_triangle(const triangle< T, 2 > &triangle)
void circle_outer_tangent_segments(const circle< T > &circle0, const circle< T > &circle1, std::vector< segment< T, 2 > > &segments)
bool operator<(const point2d< T > &point1, const point2d< T > &point2)
triangle< T, 2 > create_symmedial_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
triangle< T, 2 > create_pedal_triangle(const point2d< T > &point, const triangle< T, 2 > &triangle)
bool is_equal(const T &val1, const T &val2, const T &epsilon)
circle< T > degenerate_circle()
const int PointInside
Definition wykobi.hpp:744
circle< T > nine_point_circle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
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)
triangle< T, 2 > right_shift(const triangle< T, 2 > &triangle, const std::size_t &shift)
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))
box< T, 3 > update_box(const box< T, 3 > &box, point3d< T > &point)
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)
triangle< T, 2 > create_feuerbach_triangle(const triangle< T, 2 > &triangle)
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)
polygon< T, 2 > remove_consecutive_collinear_points(const polygon< T, 2 > &polygon)
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)
triangle< T, 2 > create_excentral_triangle(const triangle< T, 2 > &triangle)
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)
void project_point135(const T &px, const T &py, const T &distance, T &nx, T &ny)
void lengthen_segment(T &x1, T &y1, T &x2, T &y2, const T &amount)
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)
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)
point2d< T > invert_point(const point2d< T > &point, const circle< T > &circle)
bool is_right_triangle(const wykobi::triangle< T, 2 > &triangle)
point2d< T > generate_random_point(const T &dx, const T &dy)
T bezier_curve_length(const quadratic_bezier< T, 2 > &bezier, const std::size_t &point_count)
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)
segment< T, 2 > degenerate_segment2d()
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)
point2d< T > generate_point_on_segment(const segment< T, 2 > &segment, const T &t)
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)
triangle< T, 2 > create_triangle(const point2d< T > &point1, const point2d< T > &point2, const T &angle1, const T &angle2)
const int AboveOrientation
Definition wykobi.hpp:741
ray< T, 2 > make_ray(const T &ox, const T &oy, const T &dir_x, const T &dir_y)
T vertex_angle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
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)
point3d< T > degenerate_point3d()
void project_point_t(const T &srcx, const T &srcy, const T &destx, const T &desty, const T &t, T &nx, T &ny)
point3d< T > positive_infinite_point3d()
const int RightHandSide
Definition wykobi.hpp:736
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)
circle< T > inscribed_circle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
sphere< T > invert_sphere_across_sphere(const sphere< T > &sphere1, const sphere< T > &sphere2)
T vertical_mirror(const T &angle)
point2d< T > rectangle_corner(const rectangle< T > &rectangle, const std::size_t &corner_index)
bool is_convex_polygon(const polygon< T, 2 > &polygon)
triangle< T, 2 > degenerate_triangle2d()
void circle_outer_tangent_lines(const circle< T > &circle0, const circle< T > &circle1, std::vector< line< T, 2 > > &lines)
triangle< T, 3 > degenerate_triangle3d()
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)
vector2d< T > operator+(const vector2d< T > &v1, const vector2d< T > &v2)
line< T, 2 > triangle_external_bisector(const triangle< T, 2 > &triangle, const std::size_t &corner, const std::size_t &opposing_corner)
point2d< T > closest_point_on_circle_from_point(const circle< T > &circle, const point2d< T > &point)
triangle< T, 2 > vertex_triangle(const std::size_t &index, const polygon< T, 2 > polygon)
line< T, 2 > confined_triangle_median(const triangle< T, 2 > &triangle, const point2d< T > &point, const std::size_t &median)
segment< T, 2 > project_onto_axis(const point2d< T > &point, const line< T, 2 > &axis)
point2d< T > minkowski_sum(const point2d< T > &point1, const point2d< T > &point2)
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)
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)
line< T, 2 > tangent_line(const circle< T > &circle, const point2d< T > &point)
const int Cospherical
Definition wykobi.hpp:747
sphere< T > degenerate_sphere()
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_outer_vecten_triangle(const triangle< T, 2 > &triangle)
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)
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)
triangle< T, 2 > bezier_convex_hull(const quadratic_bezier< T, 2 > &bezier)
triangle< T, 2 > create_intouch_triangle(const triangle< T, 2 > &triangle)
void project_point90(const T &px, const T &py, const T &distance, T &nx, T &ny)
point2d< T > closest_point_on_bezier_from_point(const quadratic_bezier< T, 2 > &bezier, const point2d< T > &point, const std::size_t &steps=1000)
line< T, 2 > degenerate_line2d()
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
unsigned int quadrant(const T &angle)
ray< T, 2 > degenerate_ray2d()
rectangle< T > make_rectangle(const T &x1, const T &y1, const T &x2, const T &y2)
bool not_equal(const T &val1, const T &val2, const T &epsilon)
point2d< T > exmedian_point(const triangle< T, 2 > &triangle, const std::size_t &corner)
segment< T, 2 > create_parallel_segment_on_point(const line< T, 2 > &line, const point2d< T > &point)
T chebyshev_distance(const T &x1, const T &y1, const T &x2, const T &y2)
point2d< T > orthocenter(const triangle< T, 2 > &triangle)
int orientation(const T &x1, const T &y1, const T &x2, const T &y2, const T &px, const T &py)
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)
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)
quadix< T, 3 > degenerate_quadix3d()
vector3d< T > degenerate_vector3d()
triangle< T, 2 > create_antipedal_triangle(const point2d< T > &point, const triangle< T, 2 > &triangle)
T generate_random_value(const T &range)
ray< T, 3 > degenerate_ray3d()
point3d< T > negative_infinite_point3d()
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)
box< T, 3 > make_box(const T &x1, const T &y1, const T &z1, const T &x2, const T &y2, const T &z2)
void incenter(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3, T &px, T &py)
T normalize_angle(const T &angle)
segment< T, 3 > degenerate_segment3d()
segment< T, 2 > center_at_location(const segment< T, 2 > &segment, const T &x, const T &y)
line< T, 2 > create_perpendicular_bisector(const T &x1, const T &y1, const T &x2, const T &y2)
bool point_on_ray(const T &px, const T &py, const T &ox, const T &oy, const T &dx, const T &dy)
vector2d< T > degenerate_vector2d()
void project_point0(const T &px, const T &py, const T &distance, T &nx, T &ny)
triangle< T, 2 > create_cevian_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
line< T, 2 > create_perpendicular_line_at_end_point(const line< T, 2 > &line)
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))
T lay_distance(const T &x1, const T &y1, const T &x2, const T &y2)
const int LeftHandSide
Definition wykobi.hpp:737
point2d< T > positive_infinite_point2d()
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)
circle< T > update_circle(const circle< T > &circle, point2d< T > &point)
line< T, 2 > euler_line(const triangle< T, 2 > &triangle)
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)
point3d< T > closest_point_on_sphere_from_point(const sphere< T > &sphere, const point3d< T > &point)
T cartesian_angle(const T &x, const T &y)
vector2d< T > operator-(const vector2d< T > &v1, const vector2d< T > &v2)
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)
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)
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)
point3d< T > closest_point_on_sphere_from_segment(const sphere< T > &sphere, const segment< T, 3 > &segment)
point2d< T > feuerbach_point(const triangle< T, 2 > &triangle)
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)
triangle< T, 2 > create_orthic_triangle(const triangle< T, 2 > &triangle)
T operator*(const vector2d< T > &v1, const vector2d< T > &v2)
point3d< T > closest_point_on_plane_from_point(const plane< T, 3 > &plane, const point3d< T > &point)
triangle< T, 2 > create_inner_vecten_triangle(const triangle< T, 2 > &triangle)
bool convex_vertex(const std::size_t &index, const polygon< T, 2 > &polygon, const int &polygon_orientation=LeftHandSide)
void calculate_bezier_coefficients(const quadratic_bezier< T, 2 > &bezier, T &ax, T &bx, T &ay, T &by)
triangle< T, 2 > create_circumcevian_triangle(const triangle< T, 2 > &triangle, const point2d< T > &point)
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 > make_segment(const T &x1, const T &y1, const T &x2, const T &y2)
bool convex_quadix(const quadix< T, 2 > &quadix)
sphere< T > update_sphere(const sphere< T > &sphere, point3d< T > &point)
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)
segment< T, 2 > opposing_edge(const triangle< T, 2 > &triangle, const std::size_t &corner)
triangle< Float, 2 > triangle2d
Definition wykobi.hpp:782
point2d< T > cyclocevian_conjugate(const point2d< T > &point, const triangle< T, 2 > &triangle)
point2d< T > excenter(const triangle< T, 2 > &triangle, const std::size_t &corner)
point2d< T > scale(const T &dx, const T &dy, const point2d< T > &point)
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)
line< T, 2 > make_line(const T &x1, const T &y1, const T &x2, const T &y2)
point2d< T > isogonal_conjugate(const point2d< T > &point, 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)
quadix< Float, 2 > quadix2d
Definition wykobi.hpp:783
point2d< T > closest_point_on_polygon_from_point(const polygon< T, 2 > &polygon, const point2d< T > &point)
T distance_from_point_to_circle_center(const point2d< T > &point, const circle< T > &circle)
triangle< T, 2 > create_isosceles_triangle(const point2d< T > &point1, const point2d< T > &point2, const T &angle)
line< T, 3 > degenerate_line3d()
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
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)
point2d< T > closest_point_on_aabbb_from_point(const rectangle< T > &rectangle, const point2d< T > &point)
curve_point< T, 2 > make_curve_point(const T &x, const T &y, const T &t)
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)
vector2d< T > operator/(const vector2d< T > &v1, const T &scale)
quadix< Float, 3 > quadix3d
Definition wykobi.hpp:788
triangle< T, 2 > create_inner_napoleon_triangle(const triangle< T, 2 > &triangle)
void project_point180(const T &px, const T &py, const T &distance, T &nx, T &ny)
point3d< T > closest_point_on_sphere_from_sphere(const sphere< T > &sphere1, const sphere< T > &sphere2)
bool point_on_circle(const T &px, const T &py, const T &cx, const T &cy, const T &radius)
const int Clockwise
Definition wykobi.hpp:738
bool intersect_horizontal_horizontal(const segment< T, 2 > &segment1, const segment< T, 2 > &segment2)
point2d< T > symmedian_point(const triangle< T, 2 > &triangle)
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)
bool point_in_polygon_winding_number(const T &px, const T &py, const polygon< T, 2 > &polygon)
circle< T > circumcircle(const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3)
rectangle< T > aabb(const segment< T, 2 > &segment)
line< T, 2 > create_parallel_line_on_point(const line< T, 2 > &line, const point2d< T > &point)
bool collinear_vertex(const std::size_t &index, const polygon< T, 2 > &polygon)
point2d< T > make_point(const T &x, const T &y)
point2d< T > project_object(const point2d< T > &point, const T &angle, const T &distance)
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)
point2d< T > degenerate_point2d()
point2d< T > closest_point_on_circle_from_circle(const circle< T > &circle1, const circle< T > &circle2)
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)
point2d< T > translate(const T &dx, const T &dy, const point2d< T > &point)
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)
circle< T > excircle(const triangle< T, 2 > &triangle, const std::size_t &i)
void create_equilateral_triangle(const T &x1, const T &y1, const T &x2, const T &y2, T &x3, T &y3)
polygon< T, D > make_polygon(const InputIterator begin, const InputIterator end)
triangle< T, 2 > create_outer_napoleon_triangle(const triangle< T, 2 > &triangle)
segment< T, 2 > edge(const triangle< T, 2 > &triangle, const std::size_t &edge_index)
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)
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)
bool greater_than_or_equal(const T &val1, const T &val2, const T &epsilon)
quadix< T, 2 > degenerate_quadix2d()
void project_point270(const T &px, const T &py, const T &distance, T &nx, T &ny)
line< T, 2 > triangle_median(const triangle< T, 2 > &triangle, const std::size_t &median)
bool is_degenerate(const T &x1, const T &y1, const T &x2, const T &y2)
triangle< T, 2 > create_extouch_triangle(const triangle< T, 2 > &triangle)
T inverse_chebyshev_distance(const T &x1, const T &y1, const T &x2, const T &y2)
const int CoplanarOrientation
Definition wykobi.hpp:743
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)
const int CollinearOrientation
Definition wykobi.hpp:740
T distance(const T &x1, const T &y1, const T &x2, const T &y2)
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 > minkowski_difference(const point2d< T > &point1, const point2d< T > &point2)
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)
line< T, 2 > triangle_bisector(const triangle< T, 2 > &triangle, const std::size_t &bisector)
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
circle< T > make_circle(const T &x, const T &y, const T &radius)
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)
vector2d< T > make_vector(const T &x, const T &y)
void rotate(const T &rotation_angle, const T &x, const T &y, T &nx, T &ny)
point2d< T > negative_infinite_point2d()
bool polygon_within_rectangle(const polygon< T, 2 > &polygon, const rectangle< T > &rectangle)
const int CLIP_RIGHT
Definition wykobi.hpp:753
point3d< T > box_corner(const box< T, 3 > &box, const std::size_t &corner_index)
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)
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