Changeset 17161 for trunk/Mars/mbase
- Timestamp:
- 09/09/13 16:56:16 (11 years ago)
- Location:
- trunk/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mbase/MMath.cc
r11426 r17161 619 619 // Formula from: http://mathworld.wolfram.com/Line-LineIntersection.html 620 620 // 621 TVector2 MMath::GetIntersectionPoint(const TVector2 &x1, const TVector2 &y1, const TVector2 &x2, const TVector2 &y2 )621 TVector2 MMath::GetIntersectionPoint(const TVector2 &x1, const TVector2 &y1, const TVector2 &x2, const TVector2 &y2, Bool_t &rc) 622 622 { 623 623 TMatrix d(2,2); … … 629 629 const Double_t denom = d.Determinant(); 630 630 if (denom==0) 631 { 632 rc = false; 631 633 return TVector2(); 634 } 635 636 rc = true; 632 637 633 638 TMatrix l1(2,2); … … 658 663 659 664 return TVector2(X, Y); 665 } 666 667 TVector2 MMath::GetIntersectionPoint(const TVector2 &x1, const TVector2 &y1, const TVector2 &x2, const TVector2 &y2) 668 { 669 Bool_t rc; 670 return GetIntersectionPoint(x1, y1, x2, y2, rc); 660 671 } 661 672 -
trunk/Mars/mbase/MMath.h
r11426 r17161 55 55 Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x); 56 56 57 TVector2 GetIntersectionPoint(const TVector2 &x1, const TVector2 &y1, const TVector2 &x2, const TVector2 &y2, Bool_t &rc); 57 58 TVector2 GetIntersectionPoint(const TVector2 &x1, const TVector2 &y1, const TVector2 &x2, const TVector2 &y2); 58 59
Note:
See TracChangeset
for help on using the changeset viewer.