Scenic v0.8.0 Scenic.Math.Line View Source
A collection of functions to work with lines.
Lines are always two points in a tuple.
{point_a, point_b}
{{x0,y0}, {x1,y1}}
Link to this section Summary
Functions
Find the point of intersection between two lines
Find a new line that is parallel to the given line and seperated by the given distance
Round the points that define a line so that they are made up of integers
Truncate the points that define a line so that they are made up of integers
Link to this section Functions
intersection(line_a :: Scenic.Math.line(), line_b :: Scenic.Math.line()) :: Scenic.Math.point()
Find the point of intersection between two lines.
Parameters:
- line_a - A line defined by two points. {point_a, point_b}
- line_b - A line defined by two points. {point_a, point_b}
Returns: A point
parallel(line :: Scenic.Math.line(), distance :: number()) :: Scenic.Math.line()
Find a new line that is parallel to the given line and seperated by the given distance.
Parameters:
- line - A line defined by two points. {point_a, point_b}
- distance - The perpendicular distance to the new line.
Returns: A line
round(line :: Scenic.Math.line()) :: Scenic.Math.line()
Round the points that define a line so that they are made up of integers.
Parameters:
- line - A line defined by two points. {point_a, point_b}
Returns: A line
trunc(line :: Scenic.Math.line()) :: Scenic.Math.line()
Truncate the points that define a line so that they are made up of integers.
Parameters:
- line - A line defined by two points. {point_a, point_b}
Returns: A line