CONTENTS

### Equations of lines in 2 dimensions

Line, one of the graphics primitives is defined by two end points. Let be two point is affine space.

### Parametric form of line equation in 2D

• Q - P is a vector pointing from P to Q
• is a vector t times as long.
• where describes the line through P and Q. This is the parametric form of line equation.

By expressing the equation of a line mathematically, it becomes easier to compute the coordinates of the points that make up the line.

### Point slope form of line equation

Let m be the slope of the line. Then

If is the angle between the line and the positive x axis, then

where are the intervals in , respectively.

Note: The fact that the slope remains unchanged regardless of which two points are used to calculate it, implies the straightness of a line.

### Point intercept form of line equation

Let be the y intercept of the line, i.e., the point where the line intercepts the y axis. Then

is the equation of the line, where m is the slope.

### Equation of line in 3D

• Let

be two points in affine space.

is a vector pointing from P to Q.

• is a vector t times as long.
• The affine combination

describes the line through P and Q.
Restricting t to defines the line segment from P to Q.

### Vector form of line equation

Let's determine the equation of a straight line L that passes through point P and is   parallel to the direction vector as shown in the figure below.

Since is parallel to , their cross product is a zero vector.

where t is real number. This is the vector form of equation of straight line L.

### Symmetric form of line equation

Equating equations (0.9) and (0.6)

Since are components of vector parallel to the line L, it is a set of direction numbers of the line.

Equation (0.11) is the symmetric form or point-direction number form of equation of line L, where .

### Parametric equation of line in 3D

Let be any point on line L.

Substituting equations (0.4), (0.5), (0.12) in (0.13) and equating corresponding components, we obtain the following set of equations.

In the above set of equations, each point of the line corresponds to the value of the parameter m. Hence these equations are called the parametric equations of line.

The two-point form of equation of line is obtained by solving equations (0.14), (0.15), (0.16) for m

### Example

1. Find the direction vector and parametric form of line equation, given two points , .
Direction Vector
Parametric form of equation of line