Point Cloud Library (PCL)  1.14.1-dev
opennurbs_fpoint.h
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 ////////////////////////////////////////////////////////////////
18 //
19 // defines float precision point, vector, and array classes
20 //
21 ////////////////////////////////////////////////////////////////
22 #if !defined(ON_FPOINT_INC_)
23 #define ON_FPOINT_INC_
24 
25 class ON_Xform;
26 
27 class ON_2fPoint;
28 class ON_3fPoint;
29 class ON_4fPoint;
30 
31 class ON_2fVector;
32 class ON_3fVector;
33 
34 ////////////////////////////////////////////////////////////////
35 //
36 // ON_2fPoint
37 //
38 class ON_CLASS ON_2fPoint
39 {
40 public:
41  float x, y;
42 
43  static const ON_2fPoint Origin; // (0.0f,0.0f)
44 
45  // use implicit destructor, copy constructor
46  ON_2fPoint(); // x,y not initialized
47  ON_2fPoint(float x,float y);
48 
49  ON_2fPoint(const ON_3fPoint& ); // from 3f point
50  ON_2fPoint(const ON_4fPoint& ); // from 4f point
51  ON_2fPoint(const ON_2fVector& ); // from 2f vector
52  ON_2fPoint(const ON_3fVector& ); // from 3f vector
53  ON_2fPoint(const float*); // from float[2] array
54 
55  ON_2fPoint(const ON_2dPoint& ); // from 2d point
56  ON_2fPoint(const ON_3dPoint& ); // from 3d point
57  ON_2fPoint(const ON_4dPoint& ); // from 4d point
58  ON_2fPoint(const ON_2dVector& ); // from 2d vector
59  ON_2fPoint(const ON_3dVector& ); // from 3d vector
60  ON_2fPoint(const double*); // from double[2] array
61 
62  // (float*) conversion operators
63  operator float*();
64  operator const float*() const;
65 
66  // use implicit operator=(const ON_2fPoint&)
71  ON_2fPoint& operator=(const float*); // point = float[2] support
72 
78  ON_2fPoint& operator=(const double*); // point = double[2] support
79 
88 
89  ON_2fPoint operator*(int) const;
90  ON_2fPoint operator/(int) const;
91  ON_2fPoint operator*(float) const;
92  ON_2fPoint operator/(float) const;
93  ON_2dPoint operator*(double) const;
94  ON_2dPoint operator/(double) const;
95 
104 
113 
114  float operator*(const ON_2fPoint&) const; // for points acting as vectors
115  float operator*(const ON_2fVector&) const; // for points acting as vectors
116  float operator*(const ON_4fPoint&) const;
117 
118  bool operator==(const ON_2fPoint&) const;
119  bool operator!=(const ON_2fPoint&) const;
120 
121  // dictionary order comparisons
122  bool operator<=(const ON_2fPoint&) const;
123  bool operator>=(const ON_2fPoint&) const;
124  bool operator<(const ON_2fPoint&) const;
125  bool operator>(const ON_2fPoint&) const;
126 
127  // index operators mimic float[2] behavior
128  float& operator[](int);
129  float operator[](int) const;
130  float& operator[](unsigned int);
131  float operator[](unsigned int) const;
132 
133  // set 2d point value
134  void Set(float,float);
135 
136  double DistanceTo( const ON_2fPoint& ) const;
137 
139  double MaximumCoordinate() const; // absolute value of maximum coordinate
140 
141  void Zero(); // set all coordinates to zero;
142 
143  // These transform the point in place. The transformation matrix acts on
144  // the left of the point; i.e., result = transformation*point
145  void Transform(
146  const ON_Xform&
147  );
148 
149  void Rotate( // rotatation in XY plane
150  double, // angle in radians
151  const ON_2fPoint& // center of rotation
152  );
153 
154  void Rotate( // rotatation in XY plane
155  double, // sin(angle)
156  double, // cos(angle)
157  const ON_2fPoint& // center of rotation
158  );
159 };
160 
161 ON_DECL
162 ON_2fPoint operator*(int, const ON_2fPoint&);
163 
164 ON_DECL
165 ON_2fPoint operator*(float, const ON_2fPoint&);
166 
167 ON_DECL
168 ON_2dPoint operator*(double, const ON_2fPoint&);
169 
170 ////////////////////////////////////////////////////////////////
171 //
172 // ON_3fPoint
173 //
174 class ON_CLASS ON_3fPoint
175 {
176 public:
177  float x, y, z;
178 
179  static const ON_3fPoint Origin; // (0.0f,0.0f,0.0f)
180 
181  // use implicit destructor, copy constructor
182  ON_3fPoint(); // x,y,z not initialized
183  ON_3fPoint(float x,float y,float z);
184  ON_3fPoint(const ON_2fPoint& ); // from 2f point
185  ON_3fPoint(const ON_4fPoint& ); // from 4f point
186  ON_3fPoint(const ON_2fVector& ); // from 2f vector
187  ON_3fPoint(const ON_3fVector& ); // from 3f vector
188  ON_3fPoint(const float*); // from float[3] array
189 
190  ON_3fPoint(const ON_2dPoint& ); // from 2d point
191  ON_3fPoint(const ON_3dPoint& ); // from 3d point
192  ON_3fPoint(const ON_4dPoint& ); // from 4d point
193  ON_3fPoint(const ON_2dVector& ); // from 2d vector
194  ON_3fPoint(const ON_3dVector& ); // from 3d vector
195  ON_3fPoint(const double*); // from double[3] array
196 
197  // (float*) conversion operators
198  operator float*();
199  operator const float*() const;
200 
201  // use implicit operator=(const ON_3fPoint&)
206  ON_3fPoint& operator=(const float*); // point = float[3] support
207 
213  ON_3fPoint& operator=(const double*); // point = double[3] support
214 
221 
222  ON_3fPoint operator*(int) const;
223  ON_3fPoint operator/(int) const;
224  ON_3fPoint operator*(float) const;
225  ON_3fPoint operator/(float) const;
226  ON_3dPoint operator*(double) const;
227  ON_3dPoint operator/(double) const;
228 
237 
246 
247  float operator*(const ON_3fPoint&) const; // for points acting as vectors
248  float operator*(const ON_3fVector&) const; // for points acting as vectors
249  float operator*(const ON_4fPoint&) const;
250 
251  bool operator==(const ON_3fPoint&) const;
252  bool operator!=(const ON_3fPoint&) const;
253 
254  // dictionary order comparisons
255  bool operator<=(const ON_3fPoint&) const;
256  bool operator>=(const ON_3fPoint&) const;
257  bool operator<(const ON_3fPoint&) const;
258  bool operator>(const ON_3fPoint&) const;
259 
260  // index operators mimic float[3] behavior
261  float& operator[](int);
262  float operator[](int) const;
263  float& operator[](unsigned int);
264  float operator[](unsigned int) const;
265 
266  // set 3d point value
267  void Set(float,float,float);
268 
269  double DistanceTo( const ON_3fPoint& ) const;
270 
272  double MaximumCoordinate() const; // absolute value of maximum coordinate
273  double Fuzz( double = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d points
274 
275  void Zero(); // set all coordinates to zero;
276 
277  // These transform the point in place. The transformation matrix acts on
278  // the left of the point; i.e., result = transformation*point
279  void Transform(
280  const ON_Xform&
281  );
282 
283  void Rotate(
284  double, // angle in radians
285  const ON_3fVector&, // axis of rotation
286  const ON_3fPoint& // center of rotation
287  );
288 
289  void Rotate(
290  double, // sin(angle)
291  double, // cos(angle)
292  const ON_3fVector&, // axis of rotation
293  const ON_3fPoint& // center of rotation
294  );
295 };
296 
297 ON_DECL
298 ON_3fPoint operator*(int, const ON_3fPoint&);
299 
300 ON_DECL
301 ON_3fPoint operator*(float, const ON_3fPoint&);
302 
303 ON_DECL
304 ON_3dPoint operator*(double, const ON_3fPoint&);
305 
306 ////////////////////////////////////////////////////////////////
307 //
308 // ON_4fPoint (homogeneous coordinates)
309 //
310 class ON_CLASS ON_4fPoint
311 {
312 public:
313  float x, y, z, w;
314 
315  // use implicit destructor, copy constructor
316  ON_4fPoint(); // x,y,z,w not initialized
317  ON_4fPoint(float x,float y,float z,float w);
318 
319  ON_4fPoint(const ON_2fPoint& ); // from 2f point
320  ON_4fPoint(const ON_3fPoint& ); // from 3f point
321  ON_4fPoint(const ON_2fVector& ); // from 2f vector
322  ON_4fPoint(const ON_3fVector& ); // from 3f vector
323  ON_4fPoint(const float*); // from float[4] array
324 
325  ON_4fPoint(const ON_2dPoint& ); // from 2d point
326  ON_4fPoint(const ON_3dPoint& ); // from 3d point
327  ON_4fPoint(const ON_4dPoint& ); // from 4d point
328  ON_4fPoint(const ON_2dVector& ); // from 2d vector
329  ON_4fPoint(const ON_3dVector& ); // from 3d vector
330  ON_4fPoint(const double*); // from double[4] array
331 
332  // (float*) conversion operators
333  operator float*();
334  operator const float*() const;
335 
336  // use implicit operator=(const ON_4fPoint&)
341  ON_4fPoint& operator=(const float*); // point = float[4] support
342 
348  ON_4fPoint& operator=(const double*); // point = double[4] support
349 
354 
355  ON_4fPoint operator*(float) const;
356  ON_4fPoint operator/(float) const;
357  ON_4fPoint operator+(const ON_4fPoint&) const; // sum w = sqrt(w1*w2)
358  ON_4fPoint operator-(const ON_4fPoint&) const; // difference w = sqrt(w1*w2)
359 
360  float operator*(const ON_4fPoint&) const;
361 
362  // projective comparison
363  // (i.e., [x,y,z,w] == [c*x,c*y,c*z,c*w] is true for nonzero c)
364  bool operator==(ON_4fPoint) const;
365  bool operator!=(const ON_4fPoint&) const;
366 
367  // index operators mimic float[4] behavior
368  float& operator[](int);
369  float operator[](int) const;
370  float& operator[](unsigned int);
371  float operator[](unsigned int) const;
372 
373  // set 4d point value
374  void Set(float,float,float,float);
375 
377  double MaximumCoordinate() const; // absolute value of maximum coordinate
378 
379  void Zero(); // set all 4 coordinates to zero;
380  bool Normalize(); // set so x^2 + y^2 + z^2 + w^2 = 1
381 
382  // These transform the point in place. The transformation matrix acts on
383  // the left of the point; i.e., result = transformation*point
384  void Transform(
385  const ON_Xform&
386  );
387 };
388 
389 ON_DECL
390 ON_4fPoint operator*(float, const ON_4fPoint&);
391 
392 ON_DECL
393 ON_4dPoint operator*(double, const ON_4fPoint&);
394 
395 ////////////////////////////////////////////////////////////////
396 //
397 // ON_2fVector
398 //
399 class ON_CLASS ON_2fVector
400 {
401 public:
402  float x, y;
403 
404  static const ON_2fVector ZeroVector; // (0.0f,0.0f)
405  static const ON_2fVector XAxis; // (1.0f,0.0f)
406  static const ON_2fVector YAxis; // (0.0f,1.0f)
407 
408  // Description:
409  // A index driven function to get unit axis vectors.
410  // Parameters:
411  // index - [in] 0 returns (1,0), 1 returns (0,1)
412  // Returns:
413  // Unit 3d vector with vector[i] = (i==index)?1:0;
414  static const ON_2fVector& UnitVector(
415  int // index
416  );
417 
418  // use implicit destructor, copy constructor
419  ON_2fVector(); // x,y not initialized
420  ON_2fVector(float x,float y);
421  ON_2fVector(const ON_2fPoint& ); // from 2f point
422  ON_2fVector(const ON_3fPoint& ); // from 3f point
423  ON_2fVector(const ON_4fPoint& ); // from 4f point
424  ON_2fVector(const ON_3fVector& ); // from 3f vector
425  ON_2fVector(const float*); // from float[2] array
426 
427  ON_2fVector(const ON_2dPoint& ); // from 2d point
428  ON_2fVector(const ON_3dPoint& ); // from 3d point
429  ON_2fVector(const ON_4dPoint& ); // from 4d point
430  ON_2fVector(const ON_2dVector& ); // from 2d vector
431  ON_2fVector(const ON_3dVector& ); // from 3d vector
432  ON_2fVector(const double*); // from double[2] array
433 
434  // (float*) conversion operators
435  operator float*();
436  operator const float*() const;
437 
438  // use implicit operator=(const ON_2fVector&)
442  ON_2fVector& operator=(const float*); // point = float[2] support
443 
448  ON_2fVector& operator=(const double*); // point = double[2] support
449 
451 
456 
457  float operator*(const ON_2fVector&) const; // inner (dot) product
458  float operator*(const ON_2fPoint&) const; // inner (dot) product point acting as a vector
459  double operator*(const ON_2dVector&) const; // inner (dot) product
460 
461  ON_2fVector operator*(int) const;
462  ON_2fVector operator/(int) const;
463  ON_2fVector operator*(float) const;
464  ON_2fVector operator/(float) const;
465  ON_2dVector operator*(double) const;
466  ON_2dVector operator/(double) const;
467 
476 
485 
486  float operator*(const ON_4fPoint&) const;
487 
488  bool operator==(const ON_2fVector&) const;
489  bool operator!=(const ON_2fVector&) const;
490 
491  // dictionary order comparisons
492  bool operator<=(const ON_2fVector&) const;
493  bool operator>=(const ON_2fVector&) const;
494  bool operator<(const ON_2fVector&) const;
495  bool operator>(const ON_2fVector&) const;
496 
497  // index operators mimic float[2] behavior
498  float& operator[](int);
499  float operator[](int) const;
500  float& operator[](unsigned int);
501  float operator[](unsigned int) const;
502 
503  // set 2d vector value
504  void Set(float,float);
505 
507  double MaximumCoordinate() const; // absolute value of maximum coordinate
508 
509  double LengthSquared() const;
510  double Length() const;
511 
512  bool Decompose( // Computes a, b such that this vector = a*X + b*Y
513  // Returns false if unable to solve for a,b. This happens
514  // when X,Y is not really a basis.
515  //
516  // If X,Y is known to be an orthonormal frame,
517  // then a = V*X, b = V*Y will compute
518  // the same result more quickly.
519  const ON_2fVector&, // X
520  const ON_2fVector&, // Y
521  double*, // a
522  double* // b
523  ) const;
524 
526  // returns 1: this and other vectors are parallel
527  // -1: this and other vectors are anti-parallel
528  // 0: this and other vectors are not parallel
529  // or at least one of the vectors is zero
530  const ON_2fVector&, // other vector
531  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
532  ) const;
533 
535  // returns true: this and other vectors are perpendicular
536  // false: this and other vectors are not perpendicular
537  // or at least one of the vectors is zero
538  const ON_2fVector&, // other vector
539  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
540  ) const;
541 
542  void Zero(); // set all coordinates to zero;
543  void Reverse(); // negate all coordinates
544  bool Unitize(); // returns false if vector has zero length
545  bool IsUnitVector() const;
546 
547  // Description:
548  // Test a vector to see if it is very short
549  //
550  // Parameters:
551  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
552  // value used as the coordinate zero tolerance.
553  //
554  // Returns:
555  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol )
556  //
557  bool IsTiny(
558  double = ON_ZERO_TOLERANCE // tiny_tol
559  ) const;
560 
561  // Returns:
562  // true if vector is the zero vector.
563  bool IsZero() const;
564 
565  // set this vector to be perpendicular to another vector
566  bool PerpendicularTo( // Result is not unitized.
567  // returns false if input vector is zero
568  const ON_2fVector&
569  );
570 
571  // set this vector to be perpendicular to a line defined by 2 points
573  const ON_2fPoint&,
574  const ON_2fPoint&
575  );
576 };
577 
578 ON_DECL
579 ON_2fVector operator*(int, const ON_2fVector&);
580 
581 ON_DECL
582 ON_2fVector operator*(float, const ON_2fVector&);
583 
584 ON_DECL
585 ON_2dVector operator*(double, const ON_2fVector&);
586 
587 ///////////////////////////////////////////////////////////////
588 //
589 // ON_2fVector utilities
590 //
591 
592 ON_DECL
593 float
594 ON_DotProduct(
595  const ON_2fVector&,
596  const ON_2fVector&
597  );
598 
599 ON_DECL
601 ON_CrossProduct(
602  const ON_2fVector&,
603  const ON_2fVector&
604  );
605 
606 ON_DECL
607 bool
608 ON_IsOrthogonalFrame( // true if X, Y are nonzero and mutually perpendicular
609  const ON_2fVector&, // X
610  const ON_2fVector& // Y
611  );
612 
613 ON_DECL
614 bool
615 ON_IsOrthonormalFrame( // true if X, Y are orthogonal and unit length
616  const ON_2fVector&, // X
617  const ON_2fVector& // Y
618  );
619 
620 ON_DECL
621 bool
622 ON_IsRightHandFrame( // true if X, Y are orthonormal and right handed
623  const ON_2fVector&, // X
624  const ON_2fVector& // Y
625  );
626 
627 ////////////////////////////////////////////////////////////////
628 //
629 // ON_3fVector
630 //
631 class ON_CLASS ON_3fVector
632 {
633 public:
634  float x, y, z;
635 
636  static const ON_3fVector ZeroVector; // (0.0f,0.0f,0.0f)
637  static const ON_3fVector XAxis; // (1.0f,0.0f,0.0f)
638  static const ON_3fVector YAxis; // (0.0f,1.0f,0.0f)
639  static const ON_3fVector ZAxis; // (0.0f,0.0f,1.0f)
640 
641  // Description:
642  // A index driven function to get unit axis vectors.
643  // Parameters:
644  // index - [in] 0 returns (1,0,0), 1 returns (0,1,0)
645  // 2 returns (0,0,1)
646  // Returns:
647  // Unit 3d vector with vector[i] = (i==index)?1:0;
648  static const ON_3fVector& UnitVector(
649  int // index
650  );
651 
652  // use implicit destructor, copy constructor
653  ON_3fVector(); // x,y,z not initialized
654  ON_3fVector(float x,float y,float z);
655 
656  ON_3fVector(const ON_2fPoint& ); // from 2f point
657  ON_3fVector(const ON_3fPoint& ); // from 3f point
658  ON_3fVector(const ON_4fPoint& ); // from 4f point
659  ON_3fVector(const ON_2fVector& ); // from 2f vector
660  ON_3fVector(const float*); // from float[3] array
661 
662  ON_3fVector(const ON_2dPoint& ); // from 2d point
663  ON_3fVector(const ON_3dPoint& ); // from 3d point
664  ON_3fVector(const ON_4dPoint& ); // from 4d point
665  ON_3fVector(const ON_2dVector& ); // from 2d vector
666  ON_3fVector(const ON_3dVector& ); // from 3d vector
667  ON_3fVector(const double*); // from double[3] array
668 
669  // (float*) conversion operators
670  operator float*();
671  operator const float*() const;
672 
673  // use implicit operator=(const ON_3fVector&)
678  ON_3fVector& operator=(const float*); // point = float[3] support
679 
685  ON_3fVector& operator=(const double*); // point = double[3] support
686 
688 
693 
694  float operator*(const ON_3fVector&) const; // inner (dot) product
695  float operator*(const ON_3fPoint&) const; // inner (dot) product (point acting as a vector)
696  double operator*(const ON_3dVector&) const; // inner (dot) product
697 
698  ON_3fVector operator*(int) const;
699  ON_3fVector operator/(int) const;
700  ON_3fVector operator*(float) const;
701  ON_3fVector operator/(float) const;
702  ON_3dVector operator*(double) const;
703  ON_3dVector operator/(double) const;
704 
713 
722 
723  float operator*(const ON_4fPoint&) const;
724 
725  bool operator==(const ON_3fVector&) const;
726  bool operator!=(const ON_3fVector&) const;
727 
728  // dictionary order comparisons
729  bool operator<=(const ON_3fVector&) const;
730  bool operator>=(const ON_3fVector&) const;
731  bool operator<(const ON_3fVector&) const;
732  bool operator>(const ON_3fVector&) const;
733 
734  // index operators mimic float[3] behavior
735  float& operator[](int);
736  float operator[](int) const;
737  float& operator[](unsigned int);
738  float operator[](unsigned int) const;
739 
740  // set 3d vector value
741  void Set(float,float,float);
742 
744  double MaximumCoordinate() const; // absolute value of maximum coordinate
745 
746  double LengthSquared() const;
747  double Length() const;
748 
750  // returns true: this and other vectors are perpendicular
751  // false: this and other vectors are not perpendicular
752  // or at least one of the vectors is zero
753  const ON_3fVector&, // other vector
754  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
755  ) const;
756 
757  double Fuzz( double = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d vectors
758 
759  void Zero(); // set all coordinates to zero
760  void Reverse(); // negate all coordinates
761  bool Unitize(); // returns false if vector has zero length
762  bool IsUnitVector() const;
763 
764  // Description:
765  // Test a vector to see if it is very short
766  //
767  // Parameters:
768  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
769  // value used as the coordinate zero tolerance.
770  //
771  // Returns:
772  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol && fabs(z) <= tiny_tol )
773  //
774  bool IsTiny(
775  double = ON_ZERO_TOLERANCE // tiny_tol
776  ) const;
777 
778  // Returns:
779  // true if vector is the zero vector.
780  bool IsZero() const;
781 
782  // set this vector to be perpendicular to another vector
783  bool PerpendicularTo( // Result is not unitized.
784  // returns false if input vector is zero
785  const ON_3fVector&
786  );
787 
788  // These transform the vector in place. The transformation matrix acts on
789  // the left of the vector; i.e., result = transformation*vector
790  void Transform(
791  const ON_Xform& // can use ON_Xform here
792  );
793 
794  void Rotate(
795  double, // angle in radians
796  const ON_3fVector& // axis of rotation
797  );
798 
799  void Rotate(
800  double, // sin(angle)
801  double, // cos(angle)
802  const ON_3fVector& // axis of rotation
803  );
804 };
805 
806 ON_DECL
807 ON_3fVector operator*(int, const ON_3fVector&);
808 
809 ON_DECL
810 ON_3fVector operator*(float, const ON_3fVector&);
811 
812 ON_DECL
813 ON_3dVector operator*(double, const ON_3fVector&);
814 
815 ///////////////////////////////////////////////////////////////
816 //
817 // ON_3fVector utilities
818 //
819 
820 ON_DECL
821 float
822 ON_DotProduct(
823  const ON_3fVector&,
824  const ON_3fVector&
825  );
826 
827 
828 ON_DECL
830 ON_CrossProduct(
831  const ON_3fVector&,
832  const ON_3fVector&
833  );
834 
835 ON_DECL
837 ON_CrossProduct( // 3d cross product for old fashioned arrays
838  const float*, // array of 3d floats
839  const float* // array of 3d floats
840  );
841 
842 ON_DECL
843 float
844 ON_TripleProduct(
845  const ON_3fVector&,
846  const ON_3fVector&,
847  const ON_3fVector&
848  );
849 
850 ON_DECL
851 float
852 ON_TripleProduct( // 3d triple product for old fashioned arrays
853  const float*, // array of 3d floats
854  const float*, // array of 3d floats
855  const float* // array of 3d floats
856  );
857 
858 ON_DECL
859 bool
860 ON_IsOrthogonalFrame( // true if X, Y, Z are nonzero and mutually perpendicular
861  const ON_3fVector&, // X
862  const ON_3fVector&, // Y
863  const ON_3fVector& // Z
864  );
865 
866 ON_DECL
867 bool
868 ON_IsOrthonormalFrame( // true if X, Y, Z are orthogonal and unit length
869  const ON_3fVector&, // X
870  const ON_3fVector&, // Y
871  const ON_3fVector& // Z
872  );
873 
874 ON_DECL
875 bool
876 ON_IsRightHandFrame( // true if X, Y, Z are orthonormal and right handed
877  const ON_3fVector&, // X
878  const ON_3fVector&, // Y
879  const ON_3fVector& // Z
880  );
881 
882 ///////////////////////////////////////////////////////////////
883 //
884 // common points and vectors
885 //
886 
887 // ON_forigin is OBSOLETE - use ON_3fPoint::Origin
888 extern ON_EXTERN_DECL const ON_3fPoint ON_forigin; // (0.0, 0.0, 0.0)
889 
890 // ON_fxaxis is OBSOLETE - use ON_3fPoint::XAxis
891 extern ON_EXTERN_DECL const ON_3fVector ON_fxaxis; // (1.0, 0.0, 0.0)
892 
893 // ON_fyaxis is OBSOLETE - use ON_3fVector::YAxis
894 extern ON_EXTERN_DECL const ON_3fVector ON_fyaxis; // (0.0, 1.0, 0.0)
895 
896 // ON_fzaxis is OBSOLETE - use ON_3fVector::ZAxis
897 extern ON_EXTERN_DECL const ON_3fVector ON_fzaxis; // (0.0, 0.0, 1.0)
898 
899 
900 #endif
double MaximumCoordinate() const
ON_2fPoint(const ON_2dPoint &)
static const ON_2fPoint Origin
ON_2dPoint operator*(double) const
ON_2fPoint(const ON_3fVector &)
float operator[](unsigned int) const
ON_2fPoint & operator+=(const ON_2fPoint &)
ON_2fPoint(const ON_4dPoint &)
ON_2fPoint operator-(const ON_2fVector &) const
float operator[](int) const
ON_2dVector operator-(const ON_2dPoint &) const
ON_2fPoint & operator+=(const ON_3fVector &)
ON_2fPoint(const ON_3dVector &)
double DistanceTo(const ON_2fPoint &) const
ON_3fPoint operator+(const ON_3fPoint &) const
void Rotate(double, const ON_2fPoint &)
ON_2fPoint operator/(float) const
ON_2dPoint operator+(const ON_2dPoint &) const
ON_2fPoint & operator=(const ON_3fVector &)
bool operator<=(const ON_2fPoint &) const
ON_3fPoint operator-(const ON_3fVector &) const
ON_3dPoint operator+(const ON_3dVector &) const
float operator*(const ON_4fPoint &) const
bool operator==(const ON_2fPoint &) const
void Zero()
ON_2fPoint operator/(int) const
ON_2fPoint & operator=(const ON_4dPoint &)
ON_2dPoint operator/(double) const
float operator*(const ON_2fVector &) const
int MaximumCoordinateIndex() const
float & operator[](unsigned int)
ON_2fPoint(const ON_3fPoint &)
ON_2fPoint & operator=(const ON_3fPoint &)
ON_2fPoint(const double *)
ON_2fPoint(const ON_2fVector &)
void Rotate(double, double, const ON_2fPoint &)
ON_3dPoint operator+(const ON_3dPoint &) const
ON_2fVector operator-(const ON_2fPoint &) const
ON_2fPoint(const float *)
float operator*(const ON_2fPoint &) const
ON_2fPoint operator+(const ON_2fPoint &) const
ON_2fPoint & operator=(const ON_3dPoint &)
ON_2fPoint & operator*=(float)
ON_2fPoint(const ON_3dPoint &)
ON_2fPoint & operator=(const ON_2fVector &)
ON_2fPoint & operator/=(float)
ON_2fPoint & operator-=(const ON_3fVector &)
ON_2fPoint operator*(float) const
bool operator>(const ON_2fPoint &) const
ON_2fPoint & operator=(const double *)
ON_2dPoint operator+(const ON_2dVector &) const
ON_2fPoint(float x, float y)
ON_2fPoint & operator=(const ON_3dVector &)
ON_2fPoint & operator=(const ON_2dVector &)
ON_3fVector operator-(const ON_3fPoint &) const
ON_2fPoint & operator=(const ON_2dPoint &)
bool operator>=(const ON_2fPoint &) const
ON_2fPoint operator+(const ON_2fVector &) const
ON_2fPoint & operator-=(const ON_2fVector &)
ON_2fPoint(const ON_4fPoint &)
ON_3dPoint operator-(const ON_3dVector &) const
float & operator[](int)
ON_3fPoint operator+(const ON_3fVector &) const
void Set(float, float)
ON_2fPoint & operator-=(const ON_2fPoint &)
ON_3dVector operator-(const ON_3dPoint &) const
ON_2fPoint operator*(int) const
ON_2fPoint & operator=(const ON_4fPoint &)
ON_2fPoint & operator=(const float *)
ON_2dPoint operator-(const ON_2dVector &) const
ON_2fPoint & operator+=(const ON_2fVector &)
bool operator<(const ON_2fPoint &) const
bool operator!=(const ON_2fPoint &) const
void Transform(const ON_Xform &)
ON_2fPoint(const ON_2dVector &)
ON_2fVector operator/(float) const
bool operator>(const ON_2fVector &) const
ON_2fVector(const float *)
ON_2fVector operator+(const ON_2fVector &) const
bool IsPerpendicularTo(const ON_2fVector &, double=ON_DEFAULT_ANGLE_TOLERANCE) const
bool IsZero() const
ON_2fVector & operator=(const ON_3dVector &)
static const ON_2fVector ZeroVector
ON_2fVector operator-() const
ON_2fVector(const ON_3fPoint &)
ON_2fVector(const ON_4dPoint &)
ON_2fVector & operator=(const ON_2dPoint &)
bool Unitize()
void Reverse()
ON_2fVector(const ON_3fVector &)
ON_2fVector & operator+=(const ON_2fVector &)
ON_2fVector & operator=(const ON_2dVector &)
ON_2fPoint operator+(const ON_2fPoint &) const
ON_2fVector(const double *)
ON_2fVector & operator=(const ON_3fVector &)
ON_2fVector(const ON_2dPoint &)
ON_2fVector operator/(int) const
ON_2fVector(float x, float y)
float operator*(const ON_2fVector &) const
ON_2fVector(const ON_3dVector &)
bool PerpendicularTo(const ON_2fPoint &, const ON_2fPoint &)
ON_2fVector(const ON_4fPoint &)
static const ON_2fVector XAxis
double LengthSquared() const
double operator*(const ON_2dVector &) const
int IsParallelTo(const ON_2fVector &, double=ON_DEFAULT_ANGLE_TOLERANCE) const
ON_3fVector operator+(const ON_3fVector &) const
double MaximumCoordinate() const
ON_2dVector operator-(const ON_2dVector &) const
ON_2fPoint operator-(const ON_2fPoint &) const
int MaximumCoordinateIndex() const
void Set(float, float)
ON_3dVector operator+(const ON_3dVector &) const
ON_3fPoint operator+(const ON_3fPoint &) const
ON_2fVector & operator=(const double *)
bool operator==(const ON_2fVector &) const
ON_2dPoint operator-(const ON_2dPoint &) const
ON_2fVector & operator=(const ON_3dPoint &)
bool operator<(const ON_2fVector &) const
ON_2fVector & operator-=(const ON_2fVector &)
ON_2fVector operator*(float) const
float & operator[](unsigned int)
static const ON_2fVector YAxis
float & operator[](int)
ON_3dPoint operator-(const ON_3dPoint &) const
ON_2fVector & operator=(const ON_3fPoint &)
ON_3fPoint operator-(const ON_3fPoint &) const
bool Decompose(const ON_2fVector &, const ON_2fVector &, double *, double *) const
float operator[](unsigned int) const
ON_3dPoint operator+(const ON_3dPoint &) const
ON_2fVector(const ON_2dVector &)
float operator*(const ON_4fPoint &) const
ON_2dVector operator*(double) const
ON_2fVector & operator*=(float)
ON_2fVector(const ON_2fPoint &)
bool IsUnitVector() const
ON_2fVector operator*(int) const
ON_2dPoint operator+(const ON_2dPoint &) const
bool operator!=(const ON_2fVector &) const
ON_2fVector operator-(const ON_2fVector &) const
bool PerpendicularTo(const ON_2fVector &)
bool operator>=(const ON_2fVector &) const
bool operator<=(const ON_2fVector &) const
ON_2dVector operator+(const ON_2dVector &) const
float operator[](int) const
static const ON_2fVector & UnitVector(int)
ON_2fVector & operator=(const float *)
ON_2dVector operator/(double) const
double Length() const
ON_3dVector operator-(const ON_3dVector &) const
float operator*(const ON_2fPoint &) const
ON_3fVector operator-(const ON_3fVector &) const
bool IsTiny(double=ON_ZERO_TOLERANCE) const
ON_2fVector(const ON_3dPoint &)
ON_2fVector & operator/=(float)
ON_2fVector & operator=(const ON_2fPoint &)
ON_3fPoint & operator/=(float)
ON_3fPoint & operator*=(float)
ON_3fPoint(const ON_4fPoint &)
ON_3fPoint operator+(const ON_3fVector &) const
ON_3fPoint(const ON_2dVector &)
ON_3fPoint(const ON_2fVector &)
ON_3dVector operator-(const ON_3dPoint &) const
bool operator<=(const ON_3fPoint &) const
void Rotate(double, double, const ON_3fVector &, const ON_3fPoint &)
ON_3dPoint operator+(const ON_2dVector &) const
ON_3fPoint & operator=(const ON_3dPoint &)
ON_3fPoint & operator-=(const ON_3fPoint &)
ON_3fPoint operator+(const ON_3fPoint &) const
double Fuzz(double=ON_ZERO_TOLERANCE) const
float operator*(const ON_3fVector &) const
double MaximumCoordinate() const
float operator*(const ON_4fPoint &) const
ON_3fPoint & operator=(const ON_4fPoint &)
ON_3fPoint & operator=(const ON_3fVector &)
ON_3fPoint operator-(const ON_2fVector &) const
float & operator[](unsigned int)
void Rotate(double, const ON_3fVector &, const ON_3fPoint &)
ON_3fPoint(float x, float y, float z)
ON_3fPoint & operator=(const ON_3dVector &)
ON_3fPoint & operator+=(const ON_3fVector &)
void Transform(const ON_Xform &)
ON_3fPoint & operator=(const ON_4dPoint &)
float operator*(const ON_3fPoint &) const
ON_3fPoint(const ON_2dPoint &)
float operator[](unsigned int) const
ON_3fPoint operator*(float) const
ON_3fPoint(const ON_2fPoint &)
ON_3fPoint operator+(const ON_2fPoint &) const
ON_3fPoint(const ON_4dPoint &)
float operator[](int) const
float & operator[](int)
bool operator!=(const ON_3fPoint &) const
bool operator>=(const ON_3fPoint &) const
bool operator==(const ON_3fPoint &) const
ON_3fPoint operator-(const ON_3fVector &) const
ON_3dPoint operator*(double) const
void Zero()
ON_3fPoint operator/(float) const
static const ON_3fPoint Origin
ON_3fPoint operator+(const ON_2fVector &) const
ON_3fPoint(const ON_3dPoint &)
ON_3dPoint operator+(const ON_3dVector &) const
ON_3fVector operator-(const ON_3fPoint &) const
ON_3dVector operator-(const ON_2dPoint &) const
ON_3fPoint(const double *)
void Set(float, float, float)
bool operator<(const ON_3fPoint &) const
int MaximumCoordinateIndex() const
ON_3fPoint & operator=(const ON_2dPoint &)
ON_3fPoint & operator=(const double *)
ON_3dPoint operator+(const ON_3dPoint &) const
ON_3fPoint & operator=(const ON_2fVector &)
ON_3dPoint operator/(double) const
ON_3fPoint operator/(int) const
ON_3dPoint operator-(const ON_2dVector &) const
ON_3dPoint operator-(const ON_3dVector &) const
ON_3dPoint operator+(const ON_2dPoint &) const
ON_3fPoint(const float *)
ON_3fPoint & operator=(const float *)
double DistanceTo(const ON_3fPoint &) const
ON_3fPoint & operator=(const ON_2fPoint &)
ON_3fVector operator-(const ON_2fPoint &) const
ON_3fPoint(const ON_3fVector &)
ON_3fPoint operator*(int) const
ON_3fPoint & operator=(const ON_2dVector &)
ON_3fPoint & operator-=(const ON_3fVector &)
bool operator>(const ON_3fPoint &) const
ON_3fPoint & operator+=(const ON_3fPoint &)
ON_3fPoint(const ON_3dVector &)
ON_3dPoint operator+(const ON_3dPoint &) const
ON_3fVector & operator*=(float)
static const ON_3fVector ZAxis
ON_3fVector(const ON_4fPoint &)
ON_3fVector(const ON_2dVector &)
void Set(float, float, float)
ON_3fVector(const ON_3fPoint &)
ON_3dVector operator-(const ON_3dVector &) const
float operator[](unsigned int) const
bool IsUnitVector() const
ON_3fVector & operator=(const ON_2dVector &)
ON_3dPoint operator-(const ON_3dPoint &) const
ON_3dPoint operator-(const ON_2dPoint &) const
static const ON_3fVector YAxis
static const ON_3fVector XAxis
ON_3fVector(const ON_2fVector &)
bool Unitize()
float operator*(const ON_4fPoint &) const
float operator[](int) const
ON_3fVector & operator-=(const ON_3fVector &)
ON_3fVector operator*(int) const
ON_3fPoint operator+(const ON_2fPoint &) const
ON_3fVector & operator=(const ON_3dPoint &)
void Rotate(double, double, const ON_3fVector &)
ON_3fVector & operator=(const ON_3dVector &)
ON_3fVector(const ON_4dPoint &)
float operator*(const ON_3fVector &) const
double MaximumCoordinate() const
ON_3dVector operator/(double) const
ON_3dVector operator*(double) const
static const ON_3fVector & UnitVector(int)
bool operator==(const ON_3fVector &) const
ON_3fVector & operator+=(const ON_3fVector &)
ON_3fVector operator/(int) const
ON_3fVector & operator=(const double *)
bool IsTiny(double=ON_ZERO_TOLERANCE) const
double operator*(const ON_3dVector &) const
void Rotate(double, const ON_3fVector &)
bool operator>=(const ON_3fVector &) const
ON_3fVector(const ON_3dVector &)
void Reverse()
ON_3dVector operator+(const ON_3dVector &) const
bool operator!=(const ON_3fVector &) const
ON_3fPoint operator-(const ON_3fPoint &) const
ON_3fVector & operator=(const ON_2fVector &)
ON_3fPoint operator+(const ON_3fPoint &) const
ON_3fVector & operator=(const ON_4dPoint &)
float & operator[](unsigned int)
ON_3fPoint operator-(const ON_2fPoint &) const
bool operator<=(const ON_3fVector &) const
ON_3fVector & operator=(const ON_4fPoint &)
ON_3fVector & operator=(const float *)
bool PerpendicularTo(const ON_3fVector &)
float operator*(const ON_3fPoint &) const
bool operator<(const ON_3fVector &) const
bool operator>(const ON_3fVector &) const
void Transform(const ON_Xform &)
ON_3fVector & operator=(const ON_2fPoint &)
ON_3fVector operator-(const ON_2fVector &) const
float & operator[](int)
ON_3fVector(const ON_2fPoint &)
bool IsZero() const
ON_3fVector operator-() const
ON_3dPoint operator+(const ON_2dPoint &) const
static const ON_3fVector ZeroVector
ON_3fVector(const double *)
ON_3fVector operator+(const ON_2fVector &) const
double LengthSquared() const
ON_3dVector operator-(const ON_2dVector &) const
ON_3fVector operator-(const ON_3fVector &) const
ON_3fVector operator/(float) const
ON_3fVector & operator=(const ON_3fPoint &)
ON_3fVector(const ON_3dPoint &)
ON_3fVector(float x, float y, float z)
int MaximumCoordinateIndex() const
ON_3fVector & operator=(const ON_2dPoint &)
ON_3fVector operator*(float) const
ON_3fVector(const float *)
bool IsPerpendicularTo(const ON_3fVector &, double=ON_DEFAULT_ANGLE_TOLERANCE) const
double Fuzz(double=ON_ZERO_TOLERANCE) const
ON_3dVector operator+(const ON_2dVector &) const
ON_3fVector & operator/=(float)
double Length() const
ON_3fVector(const ON_2dPoint &)
ON_3fVector operator+(const ON_3fVector &) const
ON_4fPoint & operator=(const ON_3fPoint &)
int MaximumCoordinateIndex() const
ON_4fPoint & operator=(const float *)
ON_4fPoint(const float *)
ON_4fPoint operator/(float) const
float & operator[](int)
bool Normalize()
ON_4fPoint operator-(const ON_4fPoint &) const
ON_4fPoint & operator*=(float)
float operator[](int) const
ON_4fPoint & operator=(const ON_2fVector &)
ON_4fPoint(const ON_3dPoint &)
ON_4fPoint operator+(const ON_4fPoint &) const
ON_4fPoint(const ON_3dVector &)
ON_4fPoint & operator=(const ON_3dVector &)
bool operator!=(const ON_4fPoint &) const
ON_4fPoint & operator=(const ON_4dPoint &)
ON_4fPoint(const ON_2dPoint &)
ON_4fPoint(const ON_2fVector &)
ON_4fPoint & operator=(const ON_2fPoint &)
void Transform(const ON_Xform &)
ON_4fPoint(const ON_4dPoint &)
ON_4fPoint(const ON_2fPoint &)
ON_4fPoint & operator=(const ON_2dVector &)
bool operator==(ON_4fPoint) const
float & operator[](unsigned int)
float operator[](unsigned int) const
ON_4fPoint & operator-=(const ON_4fPoint &)
ON_4fPoint(const ON_3fVector &)
double MaximumCoordinate() const
ON_4fPoint & operator=(const ON_3fVector &)
ON_4fPoint(const double *)
ON_4fPoint & operator=(const ON_3dPoint &)
ON_4fPoint operator*(float) const
void Zero()
ON_4fPoint & operator=(const double *)
ON_4fPoint(const ON_2dVector &)
ON_4fPoint & operator/=(float)
ON_4fPoint & operator=(const ON_2dPoint &)
void Set(float, float, float, float)
ON_4fPoint(const ON_3fPoint &)
ON_4fPoint(float x, float y, float z, float w)
ON_4fPoint & operator+=(const ON_4fPoint &)
float operator*(const ON_4fPoint &) const