Skip to content

lines2d

David Legland edited this page Apr 12, 2018 · 1 revision

The term 'line' refers to a planar straight line, which is an unbounded curve. Line segments defined between 2 points, which are bounded, are called 'edge', and are presented in file 'edges2d'.

A straight line is defined by a point (its origin), and a vector (its direction). The different parameters are bundled into a row vector:

LINE = [x0 y0 dx dy];

A line contains all points (x,y) such that:

   x = x0 + t*dx
   y = y0 + t*dy;

for all t between -infinity and +infinity.

Functions operating on lines

createLine            - Create a straight line from 2 points, or from other inputs
medianLine            - Create a median line between two points
cartesianLine         - Create a straight line from cartesian equation coefficients
orthogonalLine        - Create a line orthogonal to another one through a point
parallelLine          - Create a line parallel to another one.
intersectLines        - Return all intersection points of N lines in 2D
lineAngle             - Computes angle between two straight lines
linePosition          - Position of a point on a line
lineFit               - Fit a straight line to a set of points
clipLine              - Clip a line with a box
reverseLine           - Return same line but with opposite orientation
transformLine         - Transform a line with an affine transform
drawLine              - Draw a straight line clipped by the current axis
Clone this wiki locally