/////////////////////////////////////////////////////////////////////// // // Given two points, ra and rb, this subroutine returns the points, rcross1 // and rcross2, at which the line co-inciding with the vector from ra to rb // intersects the sphere with radius SphRad. // The routine returns false if there is no intersection. // If one point is in the same and one is in the opposite direction of the // vector from ra to rb, it returns as rcross1 the point in the same // direction. // If both intersection points in the same direction from ra, rcross1 is set // to the point closer to ra. // f1 and f2 are the multiples of the distance between ra and rb at which // the intersecion points are located. // // Author: W. Heintzelman // // REVISION HISTORY: // 02/12/2014 : W. Heintzelman - New file // 10/24/2018 : W. Heintzelman - Extensive revisions // //////////////////////////////////////////////////////////////////////// #ifndef __RAT_SphereCrossPoint__ #define __RAT_SphereCrossPoint__ #include namespace RAT { bool SphereCrossPoint(double SphRad,TVector3& ra,TVector3& rb, TVector3& rcross1, TVector3& rcross2, double& f1, double& f2 ); } // namespace RAT #endif