refactor: added forgotten epsilon for Shape2D.ApproximatelyEquals
This commit is contained in:
@@ -184,8 +184,8 @@ public readonly struct Line2D(Vector2D from, Vector2D to)
|
||||
/// <summary>
|
||||
/// Checks if two <see cref="Line2D"/> segments are approximately equal.
|
||||
/// </summary>
|
||||
public static bool ApproximatelyEquals(Line2D left, Line2D right)
|
||||
=> left.From.ApproximatelyEquals(right.From) && left.To.ApproximatelyEquals(right.To);
|
||||
public static bool ApproximatelyEquals(Line2D left, Line2D right, float epsilon = float.Epsilon)
|
||||
=> left.From.ApproximatelyEquals(right.From, epsilon) && left.To.ApproximatelyEquals(right.To, epsilon);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -223,8 +223,5 @@ public static class Line2DExtensions
|
||||
/// </summary>
|
||||
public static bool Intersects(this Line2D left, Line2D right, [NotNullWhen(returnValue: true)] out Vector2D? point) => Line2D.Intersects(left, right, out point);
|
||||
|
||||
/// <summary>
|
||||
/// Checks if two <see cref="Line2D"/>s are approximately equal.
|
||||
/// </summary>
|
||||
public static bool ApproximatelyEquals(this Line2D left, Line2D right) => Line2D.ApproximatelyEquals(left, right);
|
||||
public static bool ApproximatelyEquals(this Line2D left, Line2D right, float epsilon = float.Epsilon) => Line2D.ApproximatelyEquals(left, right, epsilon);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user