Changeset 17161 for trunk/Mars/mbase/MMath.cc
- Timestamp:
- 09/09/13 16:56:16 (11 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.