VTK
vtkMath.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMath.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================
15  Copyright 2011 Sandia Corporation.
16  Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
17  license for use of this work by or on behalf of the
18  U.S. Government. Redistribution and use in source and binary forms, with
19  or without modification, are permitted provided that this Notice and any
20  statement of authorship are reproduced on all copies.
21 
22  Contact: pppebay@sandia.gov,dcthomp@sandia.gov
23 
24 =========================================================================*/
44 #ifndef vtkMath_h
45 #define vtkMath_h
46 
47 #include "vtkCommonCoreModule.h" // For export macro
48 #include "vtkObject.h"
49 
50 #include "vtkMathConfigure.h" // For <cmath> and VTK_HAS_ISNAN etc.
51 
52 #include <cassert> // assert() in inline implementations.
53 
54 #ifndef DBL_MIN
55 # define VTK_DBL_MIN 2.2250738585072014e-308
56 #else // DBL_MIN
57 # define VTK_DBL_MIN DBL_MIN
58 #endif // DBL_MIN
59 
60 #ifndef DBL_EPSILON
61 # define VTK_DBL_EPSILON 2.2204460492503131e-16
62 #else // DBL_EPSILON
63 # define VTK_DBL_EPSILON DBL_EPSILON
64 #endif // DBL_EPSILON
65 
66 #ifndef VTK_DBL_EPSILON
67 # ifndef DBL_EPSILON
68 # define VTK_DBL_EPSILON 2.2204460492503131e-16
69 # else // DBL_EPSILON
70 # define VTK_DBL_EPSILON DBL_EPSILON
71 # endif // DBL_EPSILON
72 #endif // VTK_DBL_EPSILON
73 
74 class vtkDataArray;
75 class vtkPoints;
76 class vtkMathInternal;
79 
81 {
82 public:
83  static vtkMath *New();
85  void PrintSelf(ostream& os, vtkIndent indent);
86 
88  static double Pi() { return 3.141592653589793; };
89 
91 
92  static float RadiansFromDegrees( float degrees);
93  static double RadiansFromDegrees( double degrees);
95 
97 
98  static float DegreesFromRadians( float radians);
99  static double DegreesFromRadians( double radians);
101 
103 
104  static int Round(float f) {
105  return static_cast<int>( f + ( f >= 0 ? 0.5 : -0.5 ) ); }
106  static int Round(double f) {
107  return static_cast<int>( f + ( f >= 0 ? 0.5 : -0.5 ) ); }
109 
112  static int Floor(double x);
113 
116  static int Ceil(double x);
117 
121  static int CeilLog2(vtkTypeUInt64 x);
122 
124  static bool IsPowerOfTwo(vtkTypeUInt64 x);
125 
129  static int NearestPowerOfTwo(int x);
130 
133  static vtkTypeInt64 Factorial( int N );
134 
138  static vtkTypeInt64 Binomial( int m, int n );
139 
146  static int* BeginCombination( int m, int n );
147 
154  static int NextCombination( int m, int n, int* combination );
155 
157  static void FreeCombination( int* combination);
158 
170  static void RandomSeed(int s);
171 
180  static int GetSeed();
181 
191  static double Random();
192 
201  static double Random( double min, double max );
202 
211  static double Gaussian();
212 
222  static double Gaussian( double mean, double std );
223 
225 
226  static void Add(const float a[3], const float b[3], float c[3]) {
227  for (int i = 0; i < 3; ++i)
228  c[i] = a[i] + b[i];
229  }
231 
233 
234  static void Add(const double a[3], const double b[3], double c[3]) {
235  for (int i = 0; i < 3; ++i)
236  c[i] = a[i] + b[i];
237  }
239 
241 
243  static void Subtract(const float a[3], const float b[3], float c[3]) {
244  for (int i = 0; i < 3; ++i)
245  c[i] = a[i] - b[i];
246  }
248 
250 
252  static void Subtract(const double a[3], const double b[3], double c[3]) {
253  for (int i = 0; i < 3; ++i)
254  c[i] = a[i] - b[i];
255  }
257 
259 
261  static void MultiplyScalar(float a[3], float s) {
262  for (int i = 0; i < 3; ++i)
263  a[i] *= s;
264  }
266 
268 
270  static void MultiplyScalar2D(float a[2], float s) {
271  for (int i = 0; i < 2; ++i)
272  a[i] *= s;
273  }
275 
277 
279  static void MultiplyScalar(double a[3], double s) {
280  for (int i = 0; i < 3; ++i)
281  a[i] *= s;
282  }
284 
286 
288  static void MultiplyScalar2D(double a[2], double s) {
289  for (int i = 0; i < 2; ++i)
290  a[i] *= s;
291  }
293 
295 
296  static float Dot(const float x[3], const float y[3]) {
297  return ( x[0] * y[0] + x[1] * y[1] + x[2] * y[2] );};
299 
301 
302  static double Dot(const double x[3], const double y[3]) {
303  return ( x[0] * y[0] + x[1] * y[1] + x[2] * y[2] );};
305 
307 
308  static void Outer(const float x[3], const float y[3], float A[3][3]) {
309  for (int i=0; i < 3; i++)
310  for (int j=0; j < 3; j++)
311  A[i][j] = x[i] * y[j];
312  }
314 
315 
316  static void Outer(const double x[3], const double y[3], double A[3][3]) {
317  for (int i=0; i < 3; i++)
318  for (int j=0; j < 3; j++)
319  A[i][j] = x[i] * y[j];
320  }
322 
324  static void Cross(const float x[3], const float y[3], float z[3]);
325 
328  static void Cross(const double x[3], const double y[3], double z[3]);
329 
331 
332  static float Norm(const float* x, int n);
333  static double Norm(const double* x, int n);
335 
337 
338  static float Norm(const float x[3]) {
339  return static_cast<float> (sqrt( x[0] * x[0] + x[1] * x[1] + x[2] * x[2] ) );};
341 
343 
344  static double Norm(const double x[3]) {
345  return sqrt( x[0] * x[0] + x[1] * x[1] + x[2] * x[2] );};
347 
349  static float Normalize(float x[3]);
350 
353  static double Normalize(double x[3]);
354 
356 
361  static void Perpendiculars(const double x[3], double y[3], double z[3],
362  double theta);
363  static void Perpendiculars(const float x[3], float y[3], float z[3],
364  double theta);
366 
368 
371  static bool ProjectVector(const float a[3], const float b[3], float projection[3]);
372  static bool ProjectVector(const double a[3], const double b[3], double projection[3]);
374 
376 
380  static bool ProjectVector2D(const float a[2], const float b[2], float projection[2]);
381  static bool ProjectVector2D(const double a[2], const double b[2], double projection[2]);
383 
385  static float Distance2BetweenPoints(const float x[3], const float y[3]);
386 
389  static double Distance2BetweenPoints(const double x[3], const double y[3]);
390 
392  static double AngleBetweenVectors(const double v1[3], const double v2[3]);
393 
397  static double GaussianAmplitude(const double variance, const double distanceFromMean);
398 
402  static double GaussianAmplitude(const double mean, const double variance, const double position);
403 
408  static double GaussianWeight(const double variance, const double distanceFromMean);
409 
414  static double GaussianWeight(const double mean, const double variance, const double position);
415 
417 
418  static float Dot2D(const float x[2], const float y[2]) {
419  return ( x[0] * y[0] + x[1] * y[1] );};
421 
423 
424  static double Dot2D(const double x[2], const double y[2]) {
425  return ( x[0] * y[0] + x[1] * y[1] );};
427 
429 
430  static void Outer2D(const float x[2], const float y[2], float A[2][2])
431  {
432  for (int i=0; i < 2; i++)
433  {
434  for (int j=0; j < 2; j++)
435  {
436  A[i][j] = x[i] * y[j];
437  }
438  }
439  }
441 
442 
443  static void Outer2D(const double x[2], const double y[2], double A[2][2])
444  {
445  for (int i=0; i < 2; i++)
446  {
447  for (int j=0; j < 2; j++)
448  {
449  A[i][j] = x[i] * y[j];
450  }
451  }
452  }
454 
456 
457  static float Norm2D(const float x[2]) {
458  return static_cast<float> (sqrt( x[0] * x[0] + x[1] * x[1] ) );};
460 
462 
463  static double Norm2D(const double x[2]) {
464  return sqrt( x[0] * x[0] + x[1] * x[1] );};
466 
468  static float Normalize2D(float x[2]);
469 
472  static double Normalize2D(double x[2]);
473 
475 
476  static float Determinant2x2(const float c1[2], const float c2[2]) {
477  return (c1[0] * c2[1] - c2[0] * c1[1] );};
479 
481 
482  static double Determinant2x2(double a, double b, double c, double d) {
483  return (a * d - b * c);};
484  static double Determinant2x2(const double c1[2], const double c2[2]) {
485  return (c1[0] * c2[1] - c2[0] * c1[1] );};
487 
489 
490  static void LUFactor3x3(float A[3][3], int index[3]);
491  static void LUFactor3x3(double A[3][3], int index[3]);
493 
495 
496  static void LUSolve3x3(const float A[3][3], const int index[3],
497  float x[3]);
498  static void LUSolve3x3(const double A[3][3], const int index[3],
499  double x[3]);
501 
503 
505  static void LinearSolve3x3(const float A[3][3], const float x[3],
506  float y[3]);
507  static void LinearSolve3x3(const double A[3][3], const double x[3],
508  double y[3]);
510 
512 
513  static void Multiply3x3(const float A[3][3], const float in[3],
514  float out[3]);
515  static void Multiply3x3(const double A[3][3], const double in[3],
516  double out[3]);
518 
520 
521  static void Multiply3x3(const float A[3][3], const float B[3][3],
522  float C[3][3]);
523  static void Multiply3x3(const double A[3][3], const double B[3][3],
524  double C[3][3]);
526 
528 
530  static void MultiplyMatrix(double **A, double **B,
531  unsigned int rowA, unsigned int colA,
532  unsigned int rowB, unsigned int colB,
533  double **C);
535 
537 
539  static void Transpose3x3(const float A[3][3], float AT[3][3]);
540  static void Transpose3x3(const double A[3][3], double AT[3][3]);
542 
544 
546  static void Invert3x3(const float A[3][3], float AI[3][3]);
547  static void Invert3x3(const double A[3][3], double AI[3][3]);
549 
551 
552  static void Identity3x3(float A[3][3]);
553  static void Identity3x3(double A[3][3]);
555 
557 
558  static double Determinant3x3(float A[3][3]);
559  static double Determinant3x3(double A[3][3]);
561 
563 
564  static float Determinant3x3(const float c1[3],
565  const float c2[3],
566  const float c3[3]);
568 
570 
571  static double Determinant3x3(const double c1[3],
572  const double c2[3],
573  const double c3[3]);
575 
577 
579  static double Determinant3x3(double a1, double a2, double a3,
580  double b1, double b2, double b3,
581  double c1, double c2, double c3);
583 
585 
589  static void QuaternionToMatrix3x3(const float quat[4], float A[3][3]);
590  static void QuaternionToMatrix3x3(const double quat[4], double A[3][3]);
592 
594 
599  static void Matrix3x3ToQuaternion(const float A[3][3], float quat[4]);
600  static void Matrix3x3ToQuaternion(const double A[3][3], double quat[4]);
602 
604 
607  static void MultiplyQuaternion( const float q1[4], const float q2[4], float q[4] );
608  static void MultiplyQuaternion( const double q1[4], const double q2[4], double q[4] );
610 
612 
615  static void Orthogonalize3x3(const float A[3][3], float B[3][3]);
616  static void Orthogonalize3x3(const double A[3][3], double B[3][3]);
618 
620 
624  static void Diagonalize3x3(const float A[3][3], float w[3], float V[3][3]);
625  static void Diagonalize3x3(const double A[3][3],double w[3],double V[3][3]);
627 
629 
636  static void SingularValueDecomposition3x3(const float A[3][3],
637  float U[3][3], float w[3],
638  float VT[3][3]);
639  static void SingularValueDecomposition3x3(const double A[3][3],
640  double U[3][3], double w[3],
641  double VT[3][3]);
643 
648  static int SolveLinearSystem(double **A, double *x, int size);
649 
653  static int InvertMatrix(double **A, double **AI, int size);
654 
656 
658  static int InvertMatrix(double **A, double **AI, int size,
659  int *tmp1Size, double *tmp2Size);
661 
677  static int LUFactorLinearSystem(double **A, int *index, int size);
678 
680 
682  static int LUFactorLinearSystem(double **A, int *index, int size,
683  double *tmpSize);
685 
687 
693  static void LUSolveLinearSystem(double **A, int *index,
694  double *x, int size);
696 
704  static double EstimateMatrixCondition(double **A, int size);
705 
707 
712  static int Jacobi(float **a, float *w, float **v);
713  static int Jacobi(double **a, double *w, double **v);
715 
717 
723  static int JacobiN(float **a, int n, float *w, float **v);
724  static int JacobiN(double **a, int n, double *w, double **v);
726 
728 
738  static int SolveHomogeneousLeastSquares(int numberOfSamples, double **xt, int xOrder,
739  double **mt);
741 
742 
744 
755  static int SolveLeastSquares(int numberOfSamples, double **xt, int xOrder,
756  double **yt, int yOrder, double **mt, int checkHomogeneous=1);
758 
760 
764  static void RGBToHSV(const float rgb[3], float hsv[3])
765  { RGBToHSV(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); }
766  static void RGBToHSV(float r, float g, float b, float *h, float *s, float *v);
767  static double* RGBToHSV(const double rgb[3]);
768  static double* RGBToHSV(double r, double g, double b);
769  static void RGBToHSV(const double rgb[3], double hsv[3])
770  { RGBToHSV(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); }
771  static void RGBToHSV(double r, double g, double b, double *h, double *s, double *v);
773 
775 
779  static void HSVToRGB(const float hsv[3], float rgb[3])
780  { HSVToRGB(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); }
781  static void HSVToRGB(float h, float s, float v, float *r, float *g, float *b);
782  static double* HSVToRGB(const double hsv[3]);
783  static double* HSVToRGB(double h, double s, double v);
784  static void HSVToRGB(const double hsv[3], double rgb[3])
785  { HSVToRGB(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); }
786  static void HSVToRGB(double h, double s, double v, double *r, double *g, double *b);
788 
790 
791  static void LabToXYZ(const double lab[3], double xyz[3]) {
792  LabToXYZ(lab[0], lab[1], lab[2], xyz+0, xyz+1, xyz+2);
793  }
794  static void LabToXYZ(double L, double a, double b,
795  double *x, double *y, double *z);
796  static double *LabToXYZ(const double lab[3]);
798 
800 
801  static void XYZToLab(const double xyz[3], double lab[3]) {
802  XYZToLab(xyz[0], xyz[1], xyz[2], lab+0, lab+1, lab+2);
803  }
804  static void XYZToLab(double x, double y, double z,
805  double *L, double *a, double *b);
806  static double *XYZToLab(const double xyz[3]);
808 
810 
811  static void XYZToRGB(const double xyz[3], double rgb[3]) {
812  XYZToRGB(xyz[0], xyz[1], xyz[2], rgb+0, rgb+1, rgb+2);
813  }
814  static void XYZToRGB(double x, double y, double z,
815  double *r, double *g, double *b);
816  static double *XYZToRGB(const double xyz[3]);
818 
820 
821  static void RGBToXYZ(const double rgb[3], double xyz[3]) {
822  RGBToXYZ(rgb[0], rgb[1], rgb[2], xyz+0, xyz+1, xyz+2);
823  }
824  static void RGBToXYZ(double r, double g, double b,
825  double *x, double *y, double *z);
826  static double *RGBToXYZ(const double rgb[3]);
828 
830 
833  static void RGBToLab(const double rgb[3], double lab[3]) {
834  RGBToLab(rgb[0], rgb[1], rgb[2], lab+0, lab+1, lab+2);
835  }
836  static void RGBToLab(double red, double green, double blue,
837  double *L, double *a, double *b);
838  static double *RGBToLab(const double rgb[3]);
840 
842 
843  static void LabToRGB(const double lab[3], double rgb[3]) {
844  LabToRGB(lab[0], lab[1], lab[2], rgb+0, rgb+1, rgb+2);
845  }
846  static void LabToRGB(double L, double a, double b,
847  double *red, double *green, double *blue);
848  static double *LabToRGB(const double lab[3]);
850 
852 
853  static void UninitializeBounds(double bounds[6]){
854  bounds[0] = 1.0;
855  bounds[1] = -1.0;
856  bounds[2] = 1.0;
857  bounds[3] = -1.0;
858  bounds[4] = 1.0;
859  bounds[5] = -1.0;
860  }
862 
864 
865  static int AreBoundsInitialized(double bounds[6]){
866  if ( bounds[1]-bounds[0]<0.0 )
867  {
868  return 0;
869  }
870  return 1;
871  }
873 
875 
877  static void ClampValue(double *value, const double range[2]);
878  static void ClampValue(double value, const double range[2], double *clamped_value);
879  static void ClampValues(
880  double *values, int nb_values, const double range[2]);
881  static void ClampValues(
882  const double *values, int nb_values, const double range[2], double *clamped_values);
884 
886 
889  static double ClampAndNormalizeValue(double value,
890  const double range[2]);
892 
894 
901  double range_min, double range_max,
902  double scale = 1.0, double shift = 0.0);
904 
906 
913  vtkDataArray *array, int comp, double range[2]);
915 
918  static int ExtentIsWithinOtherExtent(int extent1[6], int extent2[6]);
919 
923  static int BoundsIsWithinOtherBounds(double bounds1[6], double bounds2[6], double delta[3]);
924 
928  static int PointIsWithinBounds(double point[3], double bounds[6], double delta[3]);
929 
938  static double Solve3PointCircle(const double p1[3], const double p2[3], const double p3[3], double center[3]);
939 
941  static double Inf();
942 
944  static double NegInf();
945 
947  static double Nan();
948 
951  static int IsInf(double x);
952 
955  static int IsNan(double x);
956 
959  static bool IsFinite(double x);
960 
961 protected:
962  vtkMath() {}
963  ~vtkMath() {}
964 
965  static vtkMathInternal Internal;
966 private:
967  vtkMath(const vtkMath&); // Not implemented.
968  void operator=(const vtkMath&); // Not implemented.
969 };
970 
971 //----------------------------------------------------------------------------
972 inline float vtkMath::RadiansFromDegrees( float x )
973 {
974  return x * 0.017453292f;
975 }
976 
977 //----------------------------------------------------------------------------
978 inline double vtkMath::RadiansFromDegrees( double x )
979 {
980  return x * 0.017453292519943295;
981 }
982 
983 //----------------------------------------------------------------------------
984 inline float vtkMath::DegreesFromRadians( float x )
985 {
986  return x * 57.2957795131f;
987 }
988 
989 //----------------------------------------------------------------------------
990 inline double vtkMath::DegreesFromRadians( double x )
991 {
992  return x * 57.29577951308232;
993 }
994 
995 //----------------------------------------------------------------------------
996 inline bool vtkMath::IsPowerOfTwo(vtkTypeUInt64 x)
997 {
998  return ((x != 0) & ((x & (x - 1)) == 0));
999 }
1000 
1001 //----------------------------------------------------------------------------
1002 // Credit goes to Peter Hart and William Lewis on comp.lang.python 1997
1004 {
1005  unsigned int z = ((x > 0) ? x - 1 : 0);
1006  z |= z >> 1;
1007  z |= z >> 2;
1008  z |= z >> 4;
1009  z |= z >> 8;
1010  z |= z >> 16;
1011  return static_cast<int>(z + 1);
1012 }
1013 
1014 //----------------------------------------------------------------------------
1015 // Modify the trunc() operation provided by static_cast<int>() to get floor(),
1016 // Note that in C++ conditions evaluate to values of 1 or 0 (true or false).
1017 inline int vtkMath::Floor(double x)
1018 {
1019  int i = static_cast<int>(x);
1020  return i - ( i > x );
1021 }
1022 
1023 //----------------------------------------------------------------------------
1024 // Modify the trunc() operation provided by static_cast<int>() to get ceil(),
1025 // Note that in C++ conditions evaluate to values of 1 or 0 (true or false).
1026 inline int vtkMath::Ceil(double x)
1027 {
1028  int i = static_cast<int>(x);
1029  return i + ( i < x );
1030 }
1031 
1032 //----------------------------------------------------------------------------
1033 inline float vtkMath::Normalize(float x[3])
1034 {
1035  float den = vtkMath::Norm( x );
1036  if ( den != 0.0 )
1037  {
1038  for (int i=0; i < 3; i++)
1039  {
1040  x[i] /= den;
1041  }
1042  }
1043  return den;
1044 }
1045 
1046 //----------------------------------------------------------------------------
1047 inline double vtkMath::Normalize(double x[3])
1048 {
1049  double den = vtkMath::Norm( x );
1050  if ( den != 0.0 )
1051  {
1052  for (int i=0; i < 3; i++)
1053  {
1054  x[i] /= den;
1055  }
1056  }
1057  return den;
1058 }
1059 
1060 //----------------------------------------------------------------------------
1061 inline float vtkMath::Normalize2D(float x[3])
1062 {
1063  float den = vtkMath::Norm2D( x );
1064  if ( den != 0.0 )
1065  {
1066  for (int i=0; i < 2; i++)
1067  {
1068  x[i] /= den;
1069  }
1070  }
1071  return den;
1072 }
1073 
1074 //----------------------------------------------------------------------------
1075 inline double vtkMath::Normalize2D(double x[3])
1076 {
1077  double den = vtkMath::Norm2D( x );
1078  if ( den != 0.0 )
1079  {
1080  for (int i=0; i < 2; i++)
1081  {
1082  x[i] /= den;
1083  }
1084  }
1085  return den;
1086 }
1087 
1088 //----------------------------------------------------------------------------
1089 inline float vtkMath::Determinant3x3(const float c1[3],
1090  const float c2[3],
1091  const float c3[3])
1092 {
1093  return c1[0] * c2[1] * c3[2] + c2[0] * c3[1] * c1[2] + c3[0] * c1[1] * c2[2] -
1094  c1[0] * c3[1] * c2[2] - c2[0] * c1[1] * c3[2] - c3[0] * c2[1] * c1[2];
1095 }
1096 
1097 //----------------------------------------------------------------------------
1098 inline double vtkMath::Determinant3x3(const double c1[3],
1099  const double c2[3],
1100  const double c3[3])
1101 {
1102  return c1[0] * c2[1] * c3[2] + c2[0] * c3[1] * c1[2] + c3[0] * c1[1] * c2[2] -
1103  c1[0] * c3[1] * c2[2] - c2[0] * c1[1] * c3[2] - c3[0] * c2[1] * c1[2];
1104 }
1105 
1106 //----------------------------------------------------------------------------
1107 inline double vtkMath::Determinant3x3(double a1, double a2, double a3,
1108  double b1, double b2, double b3,
1109  double c1, double c2, double c3)
1110 {
1111  return ( a1 * vtkMath::Determinant2x2( b2, b3, c2, c3 )
1112  - b1 * vtkMath::Determinant2x2( a2, a3, c2, c3 )
1113  + c1 * vtkMath::Determinant2x2( a2, a3, b2, b3 ) );
1114 }
1115 
1116 //----------------------------------------------------------------------------
1117 inline float vtkMath::Distance2BetweenPoints(const float x[3],
1118  const float y[3])
1119 {
1120  return ( ( x[0] - y[0] ) * ( x[0] - y[0] )
1121  + ( x[1] - y[1] ) * ( x[1] - y[1] )
1122  + ( x[2] - y[2] ) * ( x[2] - y[2] ) );
1123 }
1124 
1125 //----------------------------------------------------------------------------
1126 inline double vtkMath::Distance2BetweenPoints(const double x[3],
1127  const double y[3])
1128 {
1129  return ( ( x[0] - y[0] ) * ( x[0] - y[0] )
1130  + ( x[1] - y[1] ) * ( x[1] - y[1] )
1131  + ( x[2] - y[2] ) * ( x[2] - y[2] ) );
1132 }
1133 
1134 //----------------------------------------------------------------------------
1135 // Cross product of two 3-vectors. Result (a x b) is stored in z[3].
1136 inline void vtkMath::Cross(const float x[3], const float y[3], float z[3])
1137 {
1138  float Zx = x[1] * y[2] - x[2] * y[1];
1139  float Zy = x[2] * y[0] - x[0] * y[2];
1140  float Zz = x[0] * y[1] - x[1] * y[0];
1141  z[0] = Zx; z[1] = Zy; z[2] = Zz;
1142 }
1143 
1144 //----------------------------------------------------------------------------
1145 // Cross product of two 3-vectors. Result (a x b) is stored in z[3].
1146 inline void vtkMath::Cross(const double x[3], const double y[3], double z[3])
1147 {
1148  double Zx = x[1] * y[2] - x[2] * y[1];
1149  double Zy = x[2] * y[0] - x[0] * y[2];
1150  double Zz = x[0] * y[1] - x[1] * y[0];
1151  z[0] = Zx; z[1] = Zy; z[2] = Zz;
1152 }
1153 
1154 //BTX
1155 //----------------------------------------------------------------------------
1156 template<class T>
1157 inline double vtkDeterminant3x3(T A[3][3])
1158 {
1159  return A[0][0] * A[1][1] * A[2][2] + A[1][0] * A[2][1] * A[0][2] +
1160  A[2][0] * A[0][1] * A[1][2] - A[0][0] * A[2][1] * A[1][2] -
1161  A[1][0] * A[0][1] * A[2][2] - A[2][0] * A[1][1] * A[0][2];
1162 }
1163 //ETX
1164 
1165 //----------------------------------------------------------------------------
1166 inline double vtkMath::Determinant3x3(float A[3][3])
1167 {
1168  return vtkDeterminant3x3( A );
1169 }
1170 
1171 //----------------------------------------------------------------------------
1172 inline double vtkMath::Determinant3x3(double A[3][3])
1173 {
1174  return vtkDeterminant3x3( A );
1175 }
1176 
1177 //----------------------------------------------------------------------------
1178 inline void vtkMath::ClampValue(double *value, const double range[2])
1179 {
1180  if (value && range)
1181  {
1182  if (*value < range[0])
1183  {
1184  *value = range[0];
1185  }
1186  else if (*value > range[1])
1187  {
1188  *value = range[1];
1189  }
1190  }
1191 }
1192 
1193 //----------------------------------------------------------------------------
1195  double value, const double range[2], double *clamped_value)
1196 {
1197  if (range && clamped_value)
1198  {
1199  if (value < range[0])
1200  {
1201  *clamped_value = range[0];
1202  }
1203  else if (value > range[1])
1204  {
1205  *clamped_value = range[1];
1206  }
1207  else
1208  {
1209  *clamped_value = value;
1210  }
1211  }
1212 }
1213 
1214 // ---------------------------------------------------------------------------
1216  const double range[2])
1217 {
1218  assert("pre: valid_range" && range[0]<=range[1]);
1219 
1220  double result;
1221  if(range[0]==range[1])
1222  {
1223  result=0.0;
1224  }
1225  else
1226  {
1227  // clamp
1228  if(value<range[0])
1229  {
1230  result=range[0];
1231  }
1232  else
1233  {
1234  if(value>range[1])
1235  {
1236  result=range[1];
1237  }
1238  else
1239  {
1240  result=value;
1241  }
1242  }
1243 
1244  // normalize
1245  result=( result - range[0] ) / ( range[1] - range[0] );
1246  }
1247 
1248  assert("post: valid_result" && result>=0.0 && result<=1.0);
1249 
1250  return result;
1251 }
1252 
1253 //-----------------------------------------------------------------------------
1254 #if defined(VTK_HAS_ISINF) || defined(VTK_HAS_STD_ISINF)
1255 #define VTK_MATH_ISINF_IS_INLINE
1256 inline int vtkMath::IsInf(double x)
1257 {
1258 #if defined(VTK_HAS_STD_ISINF)
1259  return std::isinf(x);
1260 #else
1261  return (isinf(x) != 0); // Force conversion to bool
1262 #endif
1263 }
1264 #endif
1265 
1266 //-----------------------------------------------------------------------------
1267 #if defined(VTK_HAS_ISNAN) || defined(VTK_HAS_STD_ISNAN)
1268 #define VTK_MATH_ISNAN_IS_INLINE
1269 inline int vtkMath::IsNan(double x)
1270 {
1271 #if defined(VTK_HAS_STD_ISNAN)
1272  return std::isnan(x);
1273 #else
1274  return (isnan(x) != 0); // Force conversion to bool
1275 #endif
1276 }
1277 #endif
1278 
1279 //-----------------------------------------------------------------------------
1280 #if defined(VTK_HAS_ISFINITE) || defined(VTK_HAS_STD_ISFINITE) || defined(VTK_HAS_FINITE)
1281 #define VTK_MATH_ISFINITE_IS_INLINE
1282 inline bool vtkMath::IsFinite(double x)
1283 {
1284 #if defined(VTK_HAS_STD_ISFINITE)
1285  return std::isfinite(x);
1286 #elif defined(VTK_HAS_ISFINITE)
1287  return (isfinite(x) != 0); // Force conversion to bool
1288 #else
1289  return (finite(x) != 0); // Force conversion to bool
1290 #endif
1291 }
1292 #endif
1293 
1294 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkgl::blue
GLclampf GLclampf blue
Definition: vtkgl.h:11313
vtkMath::Ceil
static int Ceil(double x)
Definition: vtkMath.h:1026
vtkMath::GetScalarTypeFittingRange
static int GetScalarTypeFittingRange(double range_min, double range_max, double scale=1.0, double shift=0.0)
vtkMath::RGBToLab
static void RGBToLab(const double rgb[3], double lab[3])
Definition: vtkMath.h:833
vtkMath::SingularValueDecomposition3x3
static void SingularValueDecomposition3x3(const float A[3][3], float U[3][3], float w[3], float VT[3][3])
vtkMathConfigure.h
vtkMath::Identity3x3
static void Identity3x3(float A[3][3])
vtkMath::MultiplyScalar
static void MultiplyScalar(double a[3], double s)
Definition: vtkMath.h:279
vtkMath::Norm
static float Norm(const float *x, int n)
vtkMath::RGBToHSV
static void RGBToHSV(const double rgb[3], double hsv[3])
Definition: vtkMath.h:769
VTKCOMMONCORE_EXPORT
#define VTKCOMMONCORE_EXPORT
Definition: vtkCommonCoreModule.h:15
vtkgl::v2
GLfloat GLfloat GLfloat v2
Definition: vtkgl.h:12015
vtkMath::Floor
static int Floor(double x)
Definition: vtkMath.h:1017
vtkMinimalStandardRandomSequence
Park and Miller Sequence of pseudo random numbers.
Definition: vtkMinimalStandardRandomSequence.h:48
vtkMath::Distance2BetweenPoints
static float Distance2BetweenPoints(const float x[3], const float y[3])
Definition: vtkMath.h:1117
vtkMath::RGBToLab
static double * RGBToLab(const double rgb[3])
vtkMath::NearestPowerOfTwo
static int NearestPowerOfTwo(int x)
Definition: vtkMath.h:1003
vtkMath::LUFactor3x3
static void LUFactor3x3(double A[3][3], int index[3])
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkMath::LabToRGB
static void LabToRGB(double L, double a, double b, double *red, double *green, double *blue)
vtkMath::Determinant2x2
static double Determinant2x2(double a, double b, double c, double d)
Definition: vtkMath.h:482
vtkMath::Multiply3x3
static void Multiply3x3(const float A[3][3], const float in[3], float out[3])
vtkgl::h
GLfloat GLfloat GLfloat GLfloat h
Definition: vtkgl.h:14364
vtkMath::RGBToHSV
static void RGBToHSV(float r, float g, float b, float *h, float *s, float *v)
vtkMath::Diagonalize3x3
static void Diagonalize3x3(const float A[3][3], float w[3], float V[3][3])
vtkMath::RGBToHSV
static void RGBToHSV(const float rgb[3], float hsv[3])
Definition: vtkMath.h:764
vtkgl::m
const GLfloat * m
Definition: vtkgl.h:18169
vtkMath::Jacobi
static int Jacobi(float **a, float *w, float **v)
vtkMath::UninitializeBounds
static void UninitializeBounds(double bounds[6])
Definition: vtkMath.h:853
vtkMath::Random
static double Random()
vtkMath::Dot2D
static float Dot2D(const float x[2], const float y[2])
Definition: vtkMath.h:418
vtkMath::RGBToHSV
static void RGBToHSV(double r, double g, double b, double *h, double *s, double *v)
vtkMath::EstimateMatrixCondition
static double EstimateMatrixCondition(double **A, int size)
vtkMath::Normalize2D
static float Normalize2D(float x[2])
vtkMath::Normalize
static float Normalize(float x[3])
Definition: vtkMath.h:1033
vtkMath::Norm
static double Norm(const double *x, int n)
vtkMath::LUSolveLinearSystem
static void LUSolveLinearSystem(double **A, int *index, double *x, int size)
vtkMath::DegreesFromRadians
static float DegreesFromRadians(float radians)
Definition: vtkMath.h:984
vtkMath::Norm2D
static double Norm2D(const double x[2])
Definition: vtkMath.h:463
vtkMath::Diagonalize3x3
static void Diagonalize3x3(const double A[3][3], double w[3], double V[3][3])
vtkMath::Norm
static double Norm(const double x[3])
Definition: vtkMath.h:344
vtkMath::LUFactorLinearSystem
static int LUFactorLinearSystem(double **A, int *index, int size, double *tmpSize)
vtkgl::scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
vtkgl::s
GLdouble s
Definition: vtkgl.h:11594
vtkMath::Multiply3x3
static void Multiply3x3(const double A[3][3], const double in[3], double out[3])
vtkMath::HSVToRGB
static void HSVToRGB(double h, double s, double v, double *r, double *g, double *b)
vtkMath::HSVToRGB
static void HSVToRGB(const double hsv[3], double rgb[3])
Definition: vtkMath.h:784
vtkMath::LUFactor3x3
static void LUFactor3x3(float A[3][3], int index[3])
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkMath::GaussianWeight
static double GaussianWeight(const double mean, const double variance, const double position)
vtkMath::XYZToRGB
static void XYZToRGB(double x, double y, double z, double *r, double *g, double *b)
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkMath::MultiplyMatrix
static void MultiplyMatrix(double **A, double **B, unsigned int rowA, unsigned int colA, unsigned int rowB, unsigned int colB, double **C)
vtkMath::RadiansFromDegrees
static float RadiansFromDegrees(float degrees)
Definition: vtkMath.h:972
vtkMath::XYZToRGB
static void XYZToRGB(const double xyz[3], double rgb[3])
Definition: vtkMath.h:811
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkMath::LUFactorLinearSystem
static int LUFactorLinearSystem(double **A, int *index, int size)
vtkMath::BeginCombination
static int * BeginCombination(int m, int n)
vtkgl::v
const GLdouble * v
Definition: vtkgl.h:11595
vtkMath::InvertMatrix
static int InvertMatrix(double **A, double **AI, int size, int *tmp1Size, double *tmp2Size)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkMath::Identity3x3
static void Identity3x3(double A[3][3])
vtkMath::MultiplyScalar
static void MultiplyScalar(float a[3], float s)
Definition: vtkMath.h:261
vtkMath::Jacobi
static int Jacobi(double **a, double *w, double **v)
vtkMath::Determinant3x3
static double Determinant3x3(float A[3][3])
Definition: vtkMath.h:1166
vtkMath::MultiplyQuaternion
static void MultiplyQuaternion(const float q1[4], const float q2[4], float q[4])
vtkX3D::center
@ center
Definition: vtkX3D.h:230
vtkMath::Subtract
static void Subtract(const float a[3], const float b[3], float c[3])
Definition: vtkMath.h:243
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkMath::HSVToRGB
static void HSVToRGB(float h, float s, float v, float *r, float *g, float *b)
vtkMath::LabToRGB
static void LabToRGB(const double lab[3], double rgb[3])
Definition: vtkMath.h:843
vtkMath::ProjectVector
static bool ProjectVector(const float a[3], const float b[3], float projection[3])
vtkMath::RGBToXYZ
static double * RGBToXYZ(const double rgb[3])
vtkMath::JacobiN
static int JacobiN(double **a, int n, double *w, double **v)
vtkgl::range
GLenum GLint * range
Definition: vtkgl.h:14180
vtkgl::in
GLuint in
Definition: vtkgl.h:16905
vtkMath::ClampAndNormalizeValue
static double ClampAndNormalizeValue(double value, const double range[2])
Definition: vtkMath.h:1215
vtkMath::LabToRGB
static double * LabToRGB(const double lab[3])
vtkMath::HSVToRGB
static void HSVToRGB(const float hsv[3], float rgb[3])
Definition: vtkMath.h:779
vtkMath::GaussianWeight
static double GaussianWeight(const double variance, const double distanceFromMean)
vtkMath::Subtract
static void Subtract(const double a[3], const double b[3], double c[3])
Definition: vtkMath.h:252
vtkgl::v1
GLfloat GLfloat v1
Definition: vtkgl.h:12014
vtkMath::Inf
static double Inf()
vtkMath::Solve3PointCircle
static double Solve3PointCircle(const double p1[3], const double p2[3], const double p3[3], double center[3])
vtkMath::SolveHomogeneousLeastSquares
static int SolveHomogeneousLeastSquares(int numberOfSamples, double **xt, int xOrder, double **mt)
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkMath::NextCombination
static int NextCombination(int m, int n, int *combination)
vtkMath::RandomSeed
static void RandomSeed(int s)
vtkMath::XYZToRGB
static double * XYZToRGB(const double xyz[3])
vtkMath::LabToXYZ
static void LabToXYZ(const double lab[3], double xyz[3])
Definition: vtkMath.h:791
vtkMath::MultiplyScalar2D
static void MultiplyScalar2D(float a[2], float s)
Definition: vtkMath.h:270
vtkMath::LabToXYZ
static void LabToXYZ(double L, double a, double b, double *x, double *y, double *z)
vtkMath::Add
static void Add(const double a[3], const double b[3], double c[3])
Definition: vtkMath.h:234
vtkMath::ProjectVector
static bool ProjectVector(const double a[3], const double b[3], double projection[3])
vtkMath::NegInf
static double NegInf()
vtkMath::Invert3x3
static void Invert3x3(const float A[3][3], float AI[3][3])
vtkMath::HSVToRGB
static double * HSVToRGB(const double hsv[3])
vtkX3D::position
@ position
Definition: vtkX3D.h:261
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkMath::LinearSolve3x3
static void LinearSolve3x3(const double A[3][3], const double x[3], double y[3])
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkMath::Transpose3x3
static void Transpose3x3(const float A[3][3], float AT[3][3])
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkCommonCoreModule.h
vtkgl::values
GLboolean GLenum GLenum GLvoid * values
Definition: vtkgl.h:11354
vtkMath::Perpendiculars
static void Perpendiculars(const double x[3], double y[3], double z[3], double theta)
vtkMath::Norm2D
static float Norm2D(const float x[2])
Definition: vtkMath.h:457
vtkgl::green
GLclampf green
Definition: vtkgl.h:11313
vtkMath::Pi
static double Pi()
Definition: vtkMath.h:88
vtkMath::MultiplyScalar2D
static void MultiplyScalar2D(double a[2], double s)
Definition: vtkMath.h:288
vtkMath::InvertMatrix
static int InvertMatrix(double **A, double **AI, int size)
vtkMath::Perpendiculars
static void Perpendiculars(const float x[3], float y[3], float z[3], double theta)
vtkMath::IsInf
static int IsInf(double x)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMath::PointIsWithinBounds
static int PointIsWithinBounds(double point[3], double bounds[6], double delta[3])
vtkMath::RGBToXYZ
static void RGBToXYZ(double r, double g, double b, double *x, double *y, double *z)
vtkMath::XYZToLab
static double * XYZToLab(const double xyz[3])
vtkMath::RGBToLab
static void RGBToLab(double red, double green, double blue, double *L, double *a, double *b)
vtkMath::RGBToHSV
static double * RGBToHSV(const double rgb[3])
vtkMath::HSVToRGB
static double * HSVToRGB(double h, double s, double v)
vtkMath::Cross
static void Cross(const float x[3], const float y[3], float z[3])
Definition: vtkMath.h:1136
vtkMath::Norm
static float Norm(const float x[3])
Definition: vtkMath.h:338
vtkMath::Nan
static double Nan()
vtkMath::Outer
static void Outer(const float x[3], const float y[3], float A[3][3])
Definition: vtkMath.h:308
vtkMath::ProjectVector2D
static bool ProjectVector2D(const double a[2], const double b[2], double projection[2])
vtkMath::LinearSolve3x3
static void LinearSolve3x3(const float A[3][3], const float x[3], float y[3])
vtkMath::Internal
static vtkMathInternal Internal
Definition: vtkMath.h:965
vtkMath::Normalize2D
static double Normalize2D(double x[2])
vtkMath::Outer2D
static void Outer2D(const double x[2], const double y[2], double A[2][2])
Definition: vtkMath.h:443
vtkMath::Matrix3x3ToQuaternion
static void Matrix3x3ToQuaternion(const double A[3][3], double quat[4])
vtkMath::GetSeed
static int GetSeed()
vtkMath::Determinant2x2
static float Determinant2x2(const float c1[2], const float c2[2])
Definition: vtkMath.h:476
vtkMath::Transpose3x3
static void Transpose3x3(const double A[3][3], double AT[3][3])
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkMath::GaussianAmplitude
static double GaussianAmplitude(const double variance, const double distanceFromMean)
vtkMath::Multiply3x3
static void Multiply3x3(const double A[3][3], const double B[3][3], double C[3][3])
vtkgl::a
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
vtkMath::GaussianAmplitude
static double GaussianAmplitude(const double mean, const double variance, const double position)
vtkObject.h
vtkMath::Factorial
static vtkTypeInt64 Factorial(int N)
vtkMath::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkMath::AreBoundsInitialized
static int AreBoundsInitialized(double bounds[6])
Definition: vtkMath.h:865
vtkMath::QuaternionToMatrix3x3
static void QuaternionToMatrix3x3(const double quat[4], double A[3][3])
vtkMath::Orthogonalize3x3
static void Orthogonalize3x3(const float A[3][3], float B[3][3])
vtkMath::XYZToLab
static void XYZToLab(double x, double y, double z, double *L, double *a, double *b)
vtkMath::Dot
static float Dot(const float x[3], const float y[3])
Definition: vtkMath.h:296
vtkMath::LUSolve3x3
static void LUSolve3x3(const double A[3][3], const int index[3], double x[3])
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkMath::Random
static double Random(double min, double max)
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkMath::LUSolve3x3
static void LUSolve3x3(const float A[3][3], const int index[3], float x[3])
vtkBoxMuellerRandomSequence
Gaussian sequence of pseudo random numbers implemented with the Box-Mueller transform.
Definition: vtkBoxMuellerRandomSequence.h:35
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkgl::result
GLuint64EXT * result
Definition: vtkgl.h:18868
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkMath::Determinant2x2
static double Determinant2x2(const double c1[2], const double c2[2])
Definition: vtkMath.h:484
vtkMath::LabToXYZ
static double * LabToXYZ(const double lab[3])
vtkMath::New
static vtkMath * New()
vtkMath::SolveLeastSquares
static int SolveLeastSquares(int numberOfSamples, double **xt, int xOrder, double **yt, int yOrder, double **mt, int checkHomogeneous=1)
vtkMath::RGBToHSV
static double * RGBToHSV(double r, double g, double b)
vtkMath::JacobiN
static int JacobiN(float **a, int n, float *w, float **v)
vtkMath::Gaussian
static double Gaussian()
vtkMath
performs common math operations
Definition: vtkMath.h:81
vtkMath::IsPowerOfTwo
static bool IsPowerOfTwo(vtkTypeUInt64 x)
Definition: vtkMath.h:996
vtkMath::Outer
static void Outer(const double x[3], const double y[3], double A[3][3])
Definition: vtkMath.h:316
vtkMath::QuaternionToMatrix3x3
static void QuaternionToMatrix3x3(const float quat[4], float A[3][3])
vtkMath::SingularValueDecomposition3x3
static void SingularValueDecomposition3x3(const double A[3][3], double U[3][3], double w[3], double VT[3][3])
vtkMath::~vtkMath
~vtkMath()
Definition: vtkMath.h:963
vtkMath::ExtentIsWithinOtherExtent
static int ExtentIsWithinOtherExtent(int extent1[6], int extent2[6])
vtkMath::Round
static int Round(double f)
Definition: vtkMath.h:106
vtkMath::XYZToLab
static void XYZToLab(const double xyz[3], double lab[3])
Definition: vtkMath.h:801
vtkMath::ProjectVector2D
static bool ProjectVector2D(const float a[2], const float b[2], float projection[2])
vtkMath::GetAdjustedScalarRange
static int GetAdjustedScalarRange(vtkDataArray *array, int comp, double range[2])
vtkMath::MultiplyQuaternion
static void MultiplyQuaternion(const double q1[4], const double q2[4], double q[4])
vtkMath::RGBToXYZ
static void RGBToXYZ(const double rgb[3], double xyz[3])
Definition: vtkMath.h:821
vtkMath::Orthogonalize3x3
static void Orthogonalize3x3(const double A[3][3], double B[3][3])
vtkMath::Round
static int Round(float f)
Definition: vtkMath.h:104
vtkMath::ClampValues
static void ClampValues(double *values, int nb_values, const double range[2])
vtkMath::AngleBetweenVectors
static double AngleBetweenVectors(const double v1[3], const double v2[3])
vtkMath::IsFinite
static bool IsFinite(double x)
vtkMath::Dot2D
static double Dot2D(const double x[2], const double y[2])
Definition: vtkMath.h:424
vtkMath::Outer2D
static void Outer2D(const float x[2], const float y[2], float A[2][2])
Definition: vtkMath.h:430
vtkMath::Add
static void Add(const float a[3], const float b[3], float c[3])
Definition: vtkMath.h:226
vtkMath::SolveLinearSystem
static int SolveLinearSystem(double **A, double *x, int size)
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkMath::IsNan
static int IsNan(double x)
vtkMath::BoundsIsWithinOtherBounds
static int BoundsIsWithinOtherBounds(double bounds1[6], double bounds2[6], double delta[3])
vtkMath::Invert3x3
static void Invert3x3(const double A[3][3], double AI[3][3])
vtkMath::Binomial
static vtkTypeInt64 Binomial(int m, int n)
q
VTKWRAPPINGJAVA_EXPORT jlong q(JNIEnv *env, jobject obj)
vtkMath::Matrix3x3ToQuaternion
static void Matrix3x3ToQuaternion(const float A[3][3], float quat[4])
vtkMath::Dot
static double Dot(const double x[3], const double y[3])
Definition: vtkMath.h:302
vtkDeterminant3x3
double vtkDeterminant3x3(T A[3][3])
Definition: vtkMath.h:1157
vtkMath::vtkMath
vtkMath()
Definition: vtkMath.h:962
vtkMath::Multiply3x3
static void Multiply3x3(const float A[3][3], const float B[3][3], float C[3][3])
vtkMath::Gaussian
static double Gaussian(double mean, double std)
vtkMath::ClampValues
static void ClampValues(const double *values, int nb_values, const double range[2], double *clamped_values)
vtkMath::ClampValue
static void ClampValue(double *value, const double range[2])
Definition: vtkMath.h:1178
vtkMath::CeilLog2
static int CeilLog2(vtkTypeUInt64 x)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkMath::FreeCombination
static void FreeCombination(int *combination)