Line
Module Geometry.Lines
In ixfx, a Line is two Points
Once you have that there are a bunch of functions to help you work with circles.
- angleRadian - compute angle, in radian
- bbox - compute bounding box
- interpolate - calculate point along line
- length - compute length of line
- midpoint - middle point of a line
- perpendicularPoint - a point perpendicular to line at a given distance.
- pointAtX - Calculates point where y intersects line at x
- relativePosition - relative position of point along line
- slope - calculate slope of line
Manipulating
- extendFromA - copy of line, extended from it’s A point
- normaliseByRect - divide by dimensions of a rectangle
- parallel - creates a parallel line at a given distance
- rotate - rotate line by a given angle and pivot
- scaleFromMidpoint - scale size of line from its midpoint
Comparison with other shapes
- distance - distance from point to nearest point on line
- nearest -nearest point on line to another point
- withinRange - returns true if point is within a given range of line
Conversions
- asPoints - Generator of A & B position for any number of lines
- fromFlatArray - a line from [x1,y1,x2,y2]
- toFlatArray
- fromNumbers - a line from (x1, y1, x2, y2)
- fromPivot - a line from an origin point
- fromPoints - a line from two points
- fromPointsToPath - a Type LinePath from two points
- joinPointsToLines - joins two or more points into an array of lines
- pointsOf - calculate integer points along line
- toPath - convert to a Type LinePath
Math
Etc