| 651 | } |
| 652 | |
| 653 | bool PlaneGeometry::IntersectionPoint(const Line3D &line, Point3D &intersectionPoint) const |
| 654 | { |
| 655 | Vector3D planeNormal = this->GetNormal(); |
| 656 | planeNormal.Normalize(); |
| 657 | |
| 658 | Vector3D lineDirection = line.GetDirection(); |
| 659 | lineDirection.Normalize(); |
| 660 | |
| 661 | double t = planeNormal * lineDirection; |
| 662 | if (fabs(t) < eps) |
| 663 | { |
| 664 | return false; |
| 665 | } |
| 666 | |
| 667 | Vector3D diff; |
| 668 | diff = this->GetOrigin() - line.GetPoint(); |
| 669 | t = (planeNormal * diff) / t; |
| 670 | |
| 671 | intersectionPoint = line.GetPoint() + lineDirection * t; |
| 672 | return true; |
| 673 | } |
| 674 | |
| 675 | bool PlaneGeometry::IntersectionPointParam(const Line3D &line, double &t) const |
| 676 | { |