/// <summary> /// Calculates the distance between a point and a solid oriented box. /// </summary> /// <param name="point">A <see cref="Vector2"/> instance.</param> /// <param name="obb">An <see cref="OrientedBox"/> instance.</param> /// <returns>The distance between a point and a solid oriented box.</returns> /// <remarks> /// Treating the oriented box as solid means that any point inside the box has /// distance zero from the box. /// </remarks> public static double Distance(Vector2 point, OrientedBox obb) { return((double)System.Math.Sqrt(SquaredDistance(point, obb))); }
/// <summary> /// Calculates the squared distance between a point and a solid oriented box. /// </summary> /// <param name="point">A <see cref="Vector2"/> instance.</param> /// <param name="obb">An <see cref="OrientedBox"/> instance.</param> /// <returns>The squared distance between a point and a solid oriented box.</returns> /// <remarks> /// Treating the oriented box as solid means that any point inside the box has /// distance zero from the box. /// </remarks> public static double SquaredDistance(Vector2 point, OrientedBox obb) { Vector2 temp; return(SquaredDistancePointSolidOrientedBox(point, obb, out temp)); }