@@ -25,7 +25,7 @@ bool MathUtils::calcBarycentricCoordinates(double x, double y, Point3D* p1, Poin
25
25
double area=triArea (p1,p2,p3);
26
26
if (area==0 )// p1, p2, p3 are in a line
27
27
{
28
- cout << " warning, triangle area should not be 0 in MathUtils::calcBarycentricCoordinates" << endl << flush;
28
+ std:: cout << " warning, triangle area should not be 0 in MathUtils::calcBarycentricCoordinates" << std:: endl << std:: flush;
29
29
return false ;
30
30
}
31
31
double area1=triArea (&p,p2,p3);
@@ -41,7 +41,7 @@ bool MathUtils::calcBarycentricCoordinates(double x, double y, Point3D* p1, Poin
41
41
}
42
42
else // null pointer
43
43
{
44
- cout << " warning, null pointer in MathUtils::calcBarycentricCoordinates" << endl << flush;
44
+ std:: cout << " warning, null pointer in MathUtils::calcBarycentricCoordinates" << std:: endl << std:: flush;
45
45
return false ;
46
46
}
47
47
}
@@ -55,7 +55,7 @@ bool MathUtils::BarycentricToXY(double u, double v, double w, Point3D* p1, Point
55
55
56
56
if (area==0 )
57
57
{
58
- cout << " warning, p1, p2 and p3 are in a line in MathUtils::BarycentricToXY" << endl << flush;
58
+ std:: cout << " warning, p1, p2 and p3 are in a line in MathUtils::BarycentricToXY" << std:: endl << std:: flush;
59
59
return false ;
60
60
}
61
61
@@ -90,7 +90,7 @@ bool MathUtils::BarycentricToXY(double u, double v, double w, Point3D* p1, Point
90
90
}
91
91
else // null pointer
92
92
{
93
- cout << " warning, null pointer in MathUtils::BarycentricToXY" << endl << flush;
93
+ std:: cout << " warning, null pointer in MathUtils::BarycentricToXY" << std:: endl << std:: flush;
94
94
return false ;
95
95
}
96
96
}
@@ -127,14 +127,15 @@ bool MathUtils::circumcenter(Point3D* p1, Point3D* p2, Point3D* p3, Point3D* res
127
127
// if one of the denominator is zero we will have problems
128
128
if (denominator==0 )
129
129
{
130
- cout << " error in MathUtils::circumcenter, the three points are in a line" << endl << flush;
130
+ std:: cout << " error in MathUtils::circumcenter, the three points are in a line" << std:: endl << std:: flush;
131
131
return false ;
132
132
}
133
133
else
134
134
{
135
135
result->setX (0.5 *(p1->getX ()*p1->getX ()*p2->getY ()-p1->getX ()*p1->getX ()*p3->getY ()-p3->getX ()*p3->getX ()*p2->getY ()-p1->getY ()*p2->getX ()*p2->getX ()-p1->getY ()*p1->getY ()*p3->getY ()-p3->getY ()*p3->getY ()*p2->getY ()+p1->getY ()*p1->getY ()*p2->getY ()+p3->getY ()*p2->getX ()*p2->getX ()-p1->getY ()*p2->getY ()*p2->getY ()+p1->getY ()*p3->getY ()*p3->getY ()+p1->getY ()*p3->getX ()*p3->getX ()+p3->getY ()*p2->getY ()*p2->getY ())/denominator);
136
136
result->setY (-0.5 *(p3->getX ()*p2->getX ()*p2->getX ()+p2->getX ()*p1->getY ()*p1->getY ()+p3->getX ()*p2->getY ()*p2->getY ()-p3->getX ()*p1->getX ()*p1->getX ()+p1->getX ()*p3->getY ()*p3->getY ()-p3->getX ()*p1->getY ()*p1->getY ()-p1->getX ()*p2->getX ()*p2->getX ()-p2->getX ()*p3->getY ()*p3->getY ()-p1->getX ()*p2->getY ()*p2->getY ()-p2->getX ()*p3->getX ()*p3->getX ()+p1->getX ()*p3->getX ()*p3->getX ()+p2->getX ()*p1->getX ()*p1->getX ())/denominator);
137
137
138
+ #if 0
138
139
//debugging: test, if the distances from p1, p2, p3 to result are equal
139
140
double dist1=sqrt((p1->getX()-result->getX())*(p1->getX()-result->getX())+(p1->getY()-result->getY())*(p1->getY()-result->getY()));
140
141
double dist2=sqrt((p2->getX()-result->getX())*(p2->getX()-result->getX())+(p2->getY()-result->getY())*(p2->getY()-result->getY()));
@@ -144,13 +145,14 @@ bool MathUtils::circumcenter(Point3D* p1, Point3D* p2, Point3D* p3, Point3D* res
144
145
{
145
146
bool debug=true;
146
147
}
148
+ #endif
147
149
148
150
return true ;
149
151
}
150
152
}
151
153
else
152
154
{
153
- cout << " null pointer in method MathUtils::circumcenter" << endl << flush;
155
+ std:: cout << " null pointer in method MathUtils::circumcenter" << std:: endl << std:: flush;
154
156
return false ;
155
157
}
156
158
}
@@ -206,7 +208,7 @@ double MathUtils::distPointFromLine(Point3D* thepoint, Point3D* p1, Point3D* p2)
206
208
}
207
209
else
208
210
{
209
- cout << " null pointer in method MathUtils::distPointFromLine" << endl << flush;
211
+ std:: cout << " null pointer in method MathUtils::distPointFromLine" << std:: endl << std:: flush;
210
212
return 0 ;
211
213
}
212
214
}
@@ -215,7 +217,7 @@ int MathUtils::faculty(int n)
215
217
{
216
218
if (n<0 )// Is faculty also defined for negative integers?
217
219
{
218
- cout << " Error, faculty of a negativ integer requested!" << endl;
220
+ std:: cout << " Error, faculty of a negativ integer requested!" << std:: endl;
219
221
return 0 ;
220
222
}
221
223
int i;
@@ -279,7 +281,7 @@ bool MathUtils::inCircle(Point3D* testp, Point3D* p1, Point3D* p2, Point3D* p3)
279
281
}
280
282
else
281
283
{
282
- cout << " null pointer in MathUtils::inCircle" << endl << flush;
284
+ std:: cout << " null pointer in MathUtils::inCircle" << std:: endl << std:: flush;
283
285
return false ;
284
286
}
285
287
}
@@ -322,7 +324,7 @@ double MathUtils::leftOf(Point3D* thepoint, Point3D* p1, Point3D* p2)
322
324
}
323
325
else
324
326
{
325
- cout << " Null pointer in MathUtils::leftOf" << endl << flush;
327
+ std:: cout << " Null pointer in MathUtils::leftOf" << std:: endl << std:: flush;
326
328
return 0 ;
327
329
}
328
330
}
@@ -365,7 +367,7 @@ bool MathUtils::lineIntersection(Point3D* p1, Point3D* p2, Point3D* p3, Point3D*
365
367
366
368
else
367
369
{
368
- cout << " null pointer in MathUtils::lineIntersection" << endl << flush;
370
+ std:: cout << " null pointer in MathUtils::lineIntersection" << std:: endl << std:: flush;
369
371
return false ;
370
372
}
371
373
}
@@ -418,7 +420,7 @@ bool MathUtils::lineIntersection(Point3D* p1, Point3D* p2, Point3D* p3, Point3D*
418
420
419
421
else
420
422
{
421
- cout << " null pointer in MathUtils::lineIntersection" << endl << flush;
423
+ std:: cout << " null pointer in MathUtils::lineIntersection" << std:: endl << std:: flush;
422
424
return false ;
423
425
}
424
426
}
@@ -497,7 +499,7 @@ double MathUtils::triArea(Point3D* pa, Point3D* pb, Point3D* pc)
497
499
}
498
500
else // null pointer
499
501
{
500
- cout << " Null pointer in MathUtils::triArea" << endl << flush;
502
+ std:: cout << " Null pointer in MathUtils::triArea" << std:: endl << std:: flush;
501
503
return 0 ;
502
504
}
503
505
}
@@ -506,7 +508,7 @@ double MathUtils::calcCubicHermitePoly(int n, int i, double t)
506
508
{
507
509
if (n!=3 ||i>n)
508
510
{
509
- cout << " error, can't calculate hermite polynom" << endl;
511
+ std:: cout << " error, can't calculate hermite polynom" << std:: endl;
510
512
}
511
513
512
514
if (n==3 &&i==0 )
@@ -530,7 +532,7 @@ double MathUtils::calcCubicHermitePoly(int n, int i, double t)
530
532
}
531
533
else // somthing went wrong
532
534
{
533
- cout << " Error in MathUtils::calcCubicHermitePoly" << endl << flush;
535
+ std:: cout << " Error in MathUtils::calcCubicHermitePoly" << std:: endl << std:: flush;
534
536
return 0 ;
535
537
}
536
538
}
@@ -539,7 +541,7 @@ double MathUtils::cFDerCubicHermitePoly(int n, int i, double t)
539
541
{
540
542
if (n!=3 ||i>n)
541
543
{
542
- cout << " error, can't calculate hermite polynom" << endl;
544
+ std:: cout << " error, can't calculate hermite polynom" << std:: endl;
543
545
}
544
546
545
547
if (n==3 &&i==0 )
@@ -569,7 +571,7 @@ double MathUtils::cFDerCubicHermitePoly(int n, int i, double t)
569
571
}
570
572
else
571
573
{
572
- cout << " Error in MathUtils::cFDerCubicHermitePoly" << endl << flush;
574
+ std:: cout << " Error in MathUtils::cFDerCubicHermitePoly" << std:: endl << std:: flush;
573
575
return 0 ;
574
576
}
575
577
}
@@ -617,7 +619,7 @@ bool MathUtils::normalLeft(Vector3D* v1, Vector3D* result, double length)
617
619
618
620
if (d<0 )// no solution in R
619
621
{
620
- cout << " Determinant Error in MathUtils::normalLeft" << endl;
622
+ std:: cout << " Determinant Error in MathUtils::normalLeft" << std:: endl;
621
623
return false ;
622
624
}
623
625
@@ -674,7 +676,7 @@ bool MathUtils::normalRight(Vector3D* v1, Vector3D* result, double length)
674
676
675
677
if (d<0 )// no solution in R
676
678
{
677
- cout << " Determinant Error in MathUtils::normalLeft" << endl;
679
+ std:: cout << " Determinant Error in MathUtils::normalLeft" << std:: endl;
678
680
return false ;
679
681
}
680
682
@@ -736,15 +738,15 @@ double MathUtils::crossVec(Point3D* first, Vector3D* vec1, Point3D* second, Vect
736
738
}
737
739
else // if a division through zero would occur
738
740
{
739
- cout << " warning in MathUtils::crossVec(...): vectors parallel to each other" << endl << flush;
741
+ std:: cout << " warning in MathUtils::crossVec(...): vectors parallel to each other" << std:: endl << std:: flush;
740
742
return 0 ;
741
743
}
742
744
}
743
745
744
746
745
747
else // null pointer
746
748
{
747
- cout << " warning in MathUtils::crossVec(...): null pointer" << endl << flush;
749
+ std:: cout << " warning in MathUtils::crossVec(...): null pointer" << std:: endl << std:: flush;
748
750
return 0 ;
749
751
}
750
752
}
@@ -786,7 +788,7 @@ bool MathUtils::normalMinDistance(Vector3D* tangent, Vector3D* target, Vector3D*
786
788
double xgalpha1=1 /(2 *xt*xt*yw*yw*zt*zt-2 *zt*zt*zt*xt*zw*xw+yt*yt*yt*yt*zw*zw+yt*yt*zw*zw*zt*zt+xt*xt*yt*yt*xw*xw+xt*xt*yw*yw*yt*yt-2 *xt*xt*xt*zt*zw*xw+yt*yt*yt*yt*xw*xw+yt*yt*yw*yw*zt*zt+2 *xt*xt*yt*yt*zw*zw-2 *yt*yt*yt*yw*zt*zw+zt*zt*xt*xt*zw*zw+zt*zt*zt*zt*xw*xw+xt*xt*zt*zt*xw*xw+2 *zt*zt*xw*xw*yt*yt-2 *xt*xt*yw*zt*yt*zw-2 *xt*yt*yt*yt*xw*yw-2 *xt*xt*xt*yw*yt*xw-2 *xt*zt*zt*xw*yt*yw-2 *xt*zt*xw*yt*yt*zw-2 *yw*zt*zt*zt*yt*zw+xt*xt*xt*xt*yw*yw+yw*yw*zt*zt*zt*zt+xt*xt*xt*xt*zw*zw);
787
789
if (xgalpha1<0 )
788
790
{
789
- cout << " warning, only complex solution of xg in MathUtils::normalMinDistance" << endl << flush;
791
+ std:: cout << " warning, only complex solution of xg in MathUtils::normalMinDistance" << std:: endl << std:: flush;
790
792
return false ;
791
793
}
792
794
xg1=sqrt (xgalpha1)*(-yt*yw*xt+yt*yt*xw+xw*zt*zt-zt*xt*zw);
@@ -796,7 +798,7 @@ bool MathUtils::normalMinDistance(Vector3D* tangent, Vector3D* target, Vector3D*
796
798
double ygalpha1=1 /(2 *xt*xt*yw*yw*zt*zt-2 *zt*zt*zt*xt*zw*xw+yt*yt*yt*yt*zw*zw+yt*yt*zw*zw*zt*zt+xt*xt*yt*yt*xw*xw+xt*xt*yw*yw*yt*yt-2 *xt*xt*xt*zt*zw*xw+yt*yt*yt*yt*xw*xw+yt*yt*yw*yw*zt*zt+2 *xt*xt*yt*yt*zw*zw-2 *yt*yt*yt*yw*zt*zw+zt*zt*xt*xt*zw*zw+zt*zt*zt*zt*xw*xw+xt*xt*zt*zt*xw*xw+2 *zt*zt*xw*xw*yt*yt-2 *xt*xt*yw*zt*yt*zw-2 *xt*yt*yt*yt*xw*yw-2 *xt*xt*xt*yw*yt*xw-2 *xt*zt*zt*xw*yt*yw-2 *xt*zt*xw*yt*yt*zw-2 *yw*zt*zt*zt*yt*zw+xt*xt*xt*xt*yw*yw+yw*yw*zt*zt*zt*zt+xt*xt*xt*xt*zw*zw);
797
799
if (ygalpha1<0 )
798
800
{
799
- cout << " warning, only complex solution of yg in MathUtils::normalMinDistance" << endl << flush;
801
+ std:: cout << " warning, only complex solution of yg in MathUtils::normalMinDistance" << std:: endl << std:: flush;
800
802
return false ;
801
803
}
802
804
yg1=-sqrt (ygalpha1)*(-yw*xt*xt-zt*zt*yw+zt*yt*zw+yt*xw*xt);
@@ -806,7 +808,7 @@ bool MathUtils::normalMinDistance(Vector3D* tangent, Vector3D* target, Vector3D*
806
808
double zgalpha1=1 /(2 *xt*xt*yw*yw*zt*zt-2 *zt*zt*zt*xt*zw*xw+yt*yt*yt*yt*zw*zw+yt*yt*zw*zw*zt*zt+xt*xt*yt*yt*xw*xw+xt*xt*yw*yw*yt*yt-2 *xt*xt*xt*zt*zw*xw+yt*yt*yt*yt*xw*xw+yt*yt*yw*yw*zt*zt+2 *xt*xt*yt*yt*zw*zw-2 *yt*yt*yt*yw*zt*zw+zt*zt*xt*xt*zw*zw+zt*zt*zt*zt*xw*xw+xt*xt*zt*zt*xw*xw+2 *zt*zt*xw*xw*yt*yt-2 *xt*xt*yw*zt*yt*zw-2 *xt*yt*yt*yt*xw*yw-2 *xt*xt*xt*yw*yt*xw-2 *xt*zt*zt*xw*yt*yw-2 *xt*zt*xw*yt*yt*zw-2 *yw*zt*zt*zt*yt*zw+xt*xt*xt*xt*yw*yw+yw*yw*zt*zt*zt*zt+xt*xt*xt*xt*zw*zw);
807
809
if (zgalpha1<0 )
808
810
{
809
- cout << " warning, only complex solution of zg in MathUtils::normalMinDistance" << endl << flush;
811
+ std:: cout << " warning, only complex solution of zg in MathUtils::normalMinDistance" << std:: endl << std:: flush;
810
812
return false ;
811
813
}
812
814
zg1=-sqrt (zgalpha1)*(yt*yw*zt-yt*yt*zw+xw*zt*xt-xt*xt*zw);
@@ -832,7 +834,7 @@ bool MathUtils::normalMinDistance(Vector3D* tangent, Vector3D* target, Vector3D*
832
834
833
835
else
834
836
{
835
- cout << " warning, null pointer in MathUtils::normalMinDistance" << endl << flush;
837
+ std:: cout << " warning, null pointer in MathUtils::normalMinDistance" << std:: endl << std:: flush;
836
838
return false ;
837
839
}
838
840
}
@@ -850,7 +852,7 @@ double MathUtils::planeTest(Point3D* test, Point3D* pt1, Point3D* pt2, Point3D*
850
852
}
851
853
else
852
854
{
853
- cout << " warning, null pointer in MathUtils::planeTest" << endl << flush;
855
+ std:: cout << " warning, null pointer in MathUtils::planeTest" << std:: endl << std:: flush;
854
856
return 0 ;
855
857
}
856
858
}
@@ -866,7 +868,7 @@ double MathUtils::angle(Point3D* p1, Point3D* p2, Point3D* p3, Point3D* p4)
866
868
}
867
869
else
868
870
{
869
- cout << " warning, null pointer in MathUtils::angle" << endl << flush;
871
+ std:: cout << " warning, null pointer in MathUtils::angle" << std:: endl << std:: flush;
870
872
return 0 ;
871
873
}
872
874
}
0 commit comments