Ejemplo n.º 1
0
 /// <summary>
 /// Computes an intersection of the ray and the circle
 /// </summary>
 public static bool RayCircle(Ray2D ray, Circle2 circle, out IntersectionRayCircle intersection)
 {
     return(RayCircle(ray.origin, ray.direction, circle.center, circle.radius, out intersection));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Tests if the point is inside the circle
 /// </summary>
 public static bool PointCircle(Vector2 point, Circle2 circle)
 {
     return(PointCircle(point, circle.center, circle.radius));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Computes an intersection of the line and the circle
 /// </summary>
 public static bool LineCircle(Line2 line, Circle2 circle, out IntersectionLineCircle intersection)
 {
     return(LineCircle(line.origin, line.direction, circle.center, circle.radius, out intersection));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Computes an intersection of the segment and the circle
 /// </summary>
 public static bool SegmentCircle(Segment2 segment, Circle2 circle, out IntersectionSegmentCircle intersection)
 {
     return(SegmentCircle(segment.a, segment.b, circle.center, circle.radius, out intersection));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Computes an intersection of the circles
 /// </summary>
 /// <returns>True if the circles intersect or one circle is contained within the other</returns>
 public static bool CircleCircle(Circle2 circleA, Circle2 circleB, out IntersectionCircleCircle intersection)
 {
     return(CircleCircle(circleA.center, circleA.radius, circleB.center, circleB.radius, out intersection));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Returns a random point inside a circle
 /// </summary>
 public static Vector2 PointInCircle2(Circle2 circle)
 {
     return(PointInCircle2(circle.center, circle.radius));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Returns the distance between the closest points on the segment and the circle
 /// </summary>
 public static float SegmentCircle(Segment2 segment, Circle2 circle)
 {
     return(SegmentCircle(segment.a, segment.b, circle.center, circle.radius));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Returns the distance between the closest points on the ray and the circle
 /// </summary>
 public static float RayCircle(Ray2D ray, Circle2 circle)
 {
     return(RayCircle(ray.origin, ray.direction, circle.center, circle.radius));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Returns the distance between the closest points on the line and the circle
 /// </summary>
 public static float LineCircle(Line2 line, Circle2 circle)
 {
     return(LineCircle(line.origin, line.direction, circle.center, circle.radius));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Returns the distance between the closest points on the circles
 /// </summary>
 /// <returns>
 /// Positive value if the circles do not intersect, negative otherwise.
 /// Negative value can be interpreted as depth of penetration.
 /// </returns>
 public static float CircleCircle(Circle2 circleA, Circle2 circleB)
 {
     return(CircleCircle(circleA.center, circleA.radius, circleB.center, circleB.radius));
 }