/// <summary> /// Returns a distance to the closest point on the line /// </summary> public static float PointLine(Vector3 point, Line3 line) { return(Vector3.Distance(point, Closest.PointLine(point, line))); }
/// <summary> /// Returns the distance between the closest points on the line and the sphere /// </summary> public static float LineSphere(Line3 line, Sphere sphere) { return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius)); }
/// <summary> /// Finds closest points on the line and the sphere /// </summary> public static void LineSphere(Line3 line, Sphere sphere, out Vector3 linePoint, out Vector3 spherePoint) { LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out linePoint, out spherePoint); }
/// <summary> /// Projects the point onto the line /// </summary> /// <param name="projectedX">Position of the projected point on the line relative to the origin</param> public static Vector3 PointLine(Vector3 point, Line3 line, out float projectedX) { return(PointLine(point, line.origin, line.direction, out projectedX)); }
/// <summary> /// Returns a distance to the closest point on the line /// </summary> public static float PointLine(Vector3 point, Line3 line) { return(Vector3.Distance(point, Geometry.ClosestPointOnLine(point, line))); }
/// <summary> /// Computes an intersection of the lines /// </summary> public static bool LineLine(Line3 lineA, Line3 lineB) { return(LineLine(lineA.origin, lineA.direction, lineB.origin, lineB.direction, out Vector3 intersection)); }
/// <summary> /// Computes an intersection of the line and the sphere /// </summary> public static bool LineSphere(Line3 line, Sphere sphere, out IntersectionLineSphere intersection) { return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out intersection)); }
/// <summary> /// Tests if the point lies on the line /// </summary> public static bool PointLine(Vector3 point, Line3 line) { return(PointLine(point, line.origin, line.direction)); }
/// <summary> /// Computes an intersection of the line and the sphere /// </summary> public static bool LineSphere(Line3 line, Sphere sphere, out Vector3 pointA, out Vector3 pointB) { return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out pointA, out pointB)); }