A line is the infinite extension of the shortest connection between two points. Visually, a line is an infinitely long, straight line. There is always exactly one straight line between two points.
All straight lines can be represented by a linear equation, therefore straight lines are also called linear functions .
This article deals with straight lines in ordinary analysis. For straight lines in analytic geometry see: Article on the subject
General line equation
To set up the straight line, you only need the slope and the intersection of the straight line with the -axis.
In this equation, is the slope of the straight line and is the -value where the straight line intersects the -axis.
Constituents of a line equation
A straight line equation consists of a gradient and the -axis intercept . These components are explained in more detail below.
As an example consider the line:

Slope/Gradient
The slope indicates how steep a straight line climbs or falls. From the given equation, one can read out the gradient .
If you did not know this, you can also determine the gradient using a gradient triangle. To do this, you need at least two different points, which you can obtain by inserting different -values.
The -axis intercept
The -axis intercept indicates the -value at which the straight line intersects the -axis. The value is also obtained by inserting zero for into the equation of the straight line, since is omitted for the case and only remains from the original equation.
The fact that the -axis intercept has the value 3 in the example can also be seen in the drawing from the line intersecting the -axis at point . has the coordinates .
Calculate the equation of a line through two points
Example: Given are the points and . Calculate the equation of the straight line that passes through and .
Calculate the slope using the difference quotient
Plug and any point into the equation of the line to determine . We use the point .
Substitute and into the general equation of a line.
Calculate the equation of the straight line given the -axis intercept and a point .
Example: Given are the -axis intercept and the point . Calculate the corresponding equation of a straight line.
1. Insert and the coordinates of the point into the general line equation and solve for .
2. Substitute and into the general equation of a straight line
General lines (interaktive)
Special lines
Lines through the origin
Such a straight line always has the equation , since holds.
A line through the origin may also represent a direct proportionality.

Constant function
A line that is parallel to the -axis has the form and is the line of a constant function because it always takes the same, constant value.

Vertical line
A line parallel to the -axis does not correspond to a function (see definition of a function), but to a relation. It cannot be described with the general equation of a straight line because the gradient would be infinite.
An equation for a vertical line has the form .

The identity line
The line through the origin corresponding to the function is called the identity line. It is the bisector of the first and third quadrants of the coordinate system.
