Click or drag to resize
Accord.NET (logo)

LineFromSlopeIntercept Method

Creates a Line with the specified slope and intercept.

Namespace:  Accord.Math.Geometry
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
public static Line FromSlopeIntercept(
	float slope,
	float intercept
Request Example View Source


Type: SystemSingle
The slope of the line
Type: SystemSingle
The Y-intercept of the line, unless the slope is an infinity, in which case the line's equation is "x = intercept" instead.

Return Value

Type: Line
Returns a Line representing the specified line.

The construction here follows the same rules as for the rest of this class. Most lines are expressed as y = slope * x + intercept. Vertical lines, however, are x = intercept. This is indicated by IsVertical being true or by Slope returning PositiveInfinity or NegativeInfinity.

See Also