Syntriax.Engine/Engine.Physics2D/Primitives/LineEquation.cs

9 lines
333 B
C#

namespace Syntriax.Engine.Physics2D.Primitives;
public record LineEquation(float Slope, float OffsetY)
{
public float Resolve(float x) => Slope * x + OffsetY; // y = mx + b
public bool ApproximatelyEquals(LineEquation other)
=> Slope.ApproximatelyEquals(other.Slope) && OffsetY.ApproximatelyEquals(other.OffsetY);
}