Function VectorMath.LineCircleIntersectionFactors
LineCircleIntersectionFactors
(float2 point, float2 direction, float radius, out float t1, out float t2)
Calculates the two intersection points (point + direction*t) on the line where it intersects with a circle at the origin.
Public
Static
bool LineCircleIntersectionFactors (
float2 | point | A point on the line |
float2 | direction | The normalized direction of the line |
float | radius | The radius of the circle at the origin. |
out float | t1 | The first intersection (if any). |
out float | t2 | The second intersection (if any). |
Calculates the two intersection points (point + direction*t) on the line where it intersects with a circle at the origin.
t1 will always be less than or equal to t2 if there are intersections.
Returns false if there are no intersections.