C# Class Methods.LineSweepPoint.GeometryUtil

Exibir arquivo Open project: Strilanc/Methods

Public Methods

Method Description
LerpProjectOnto ( this point, LineSegment line ) : double

The proportion that, when lerped across the given line, results in the given point. If the point is not on the line segment, the result is the closest point on the extended line.

QuadraticRoots ( double a, double b, double c ) : IEnumerable

Enumerates the real solutions to the formula a*x^2 + b*x + c = 0. Handles degenerate cases. If a=b=c=0 then only zero is enumerated, even though technically all real numbers are solutions.

WhenLineSweepsPoint ( LineSegment pathOfLineStartPoint, LineSegment pathOfLineEndPoint, Point point ) : IEnumerable

Enumerates the times and places, if any, where a moving line crosses a point during a time step. The line's endpoints move at a constant rate along their linear paths.

Method Details

LerpProjectOnto() public static method

The proportion that, when lerped across the given line, results in the given point. If the point is not on the line segment, the result is the closest point on the extended line.
public static LerpProjectOnto ( this point, LineSegment line ) : double
point this
line LineSegment
return double

QuadraticRoots() public static method

Enumerates the real solutions to the formula a*x^2 + b*x + c = 0. Handles degenerate cases. If a=b=c=0 then only zero is enumerated, even though technically all real numbers are solutions.
public static QuadraticRoots ( double a, double b, double c ) : IEnumerable
a double
b double
c double
return IEnumerable

WhenLineSweepsPoint() public static method

Enumerates the times and places, if any, where a moving line crosses a point during a time step. The line's endpoints move at a constant rate along their linear paths.
public static WhenLineSweepsPoint ( LineSegment pathOfLineStartPoint, LineSegment pathOfLineEndPoint, Point point ) : IEnumerable
pathOfLineStartPoint LineSegment
pathOfLineEndPoint LineSegment
point Point
return IEnumerable