2023-12-07 10:55:49 +03:00
|
|
|
namespace Syntriax.Engine.Physics2D.Primitives;
|
|
|
|
|
|
|
|
public record LineEquation(float Slope, float OffsetY)
|
|
|
|
{
|
|
|
|
public float Resolve(float x) => Slope * x + OffsetY; // y = mx + b
|
2023-12-07 11:14:18 +03:00
|
|
|
public bool ApproximatelyEquals(LineEquation other)
|
|
|
|
=> Slope.ApproximatelyEquals(other.Slope) && OffsetY.ApproximatelyEquals(other.OffsetY);
|
2023-12-07 10:55:49 +03:00
|
|
|
}
|