Line Equation From Two Points Calculator
Solve line equation two points problems step-by-step with our free calculator. See formulas, worked examples, and clear explanations.
Formula
y - y\u2081 = [(y\u2082 - y\u2081) / (x\u2082 - x\u2081)] \u00D7 (x - x\u2081)
Calculate the slope m = (y\u2082 - y\u2081)/(x\u2082 - x\u2081) from two points, then use point-slope form. Convert to slope-intercept (y = mx + b) or standard form (Ax + By = C) as needed.
Worked Examples
Example 1: Line Through Two Points
Problem: Find the equation of the line passing through (1, 2) and (5, 10).
Solution: Slope = (10 - 2) / (5 - 1) = 8 / 4 = 2\ny-intercept = 2 - 2(1) = 0\nSlope-intercept: y = 2x\nStandard form: 2x - y = 0\nAngle of inclination: arctan(2) = 63.43\u00B0\nMidpoint: (3, 6)\nDistance: sqrt(16 + 64) = sqrt(80) = 8.944
Result: y = 2x | Standard: 2x - y = 0 | Angle: 63.43\u00B0
Example 2: Line with Negative Slope
Problem: Find the equation of the line through (0, 8) and (4, 0).
Solution: Slope = (0 - 8) / (4 - 0) = -8 / 4 = -2\ny-intercept = 8 - (-2)(0) = 8\nSlope-intercept: y = -2x + 8\nStandard form: 2x + y = 8\nx-intercept: x = -8/(-2) = 4\nPerpendicular slope: 1/2\nMidpoint: (2, 4)
Result: y = -2x + 8 | Standard: 2x + y = 8 | Intercepts: (0,8) and (4,0)
Frequently Asked Questions
How do you find the equation of a line from two points?
To find the equation of a line passing through two points (x1, y1) and (x2, y2), first calculate the slope: m = (y2 - y1) / (x2 - x1). Then use the point-slope form y - y1 = m(x - x1) with either point. Simplify to get slope-intercept form y = mx + b by distributing the slope and solving for y. The y-intercept b = y1 - m * x1. For example, given points (1, 3) and (4, 9): slope = (9-3)/(4-1) = 2, then y - 3 = 2(x - 1), which gives y = 2x + 1. This method works for any two distinct points that do not share the same x-coordinate.
What are the different forms of a line equation?
There are several standard forms for writing a line equation. Slope-intercept form (y = mx + b) directly shows the slope m and y-intercept b, making it easy to graph. Point-slope form (y - y1 = m(x - x1)) is useful when you know a point and the slope. Standard form (Ax + By = C) uses integer coefficients and is preferred for systems of equations. Parametric form uses a parameter t: x = x1 + t*dx, y = y1 + t*dy. Normal form uses the perpendicular distance from the origin. Each form has advantages for different applications. Converting between forms involves algebraic manipulation but does not change the underlying line.
What is the standard form of a line equation?
The standard form of a line equation is Ax + By = C, where A, B, and C are integers (by convention), A is positive, and the greatest common divisor of A, B, and C is 1. To convert from slope-intercept form y = mx + b, rearrange to -mx + y = b, then multiply through to clear fractions. For example, y = (2/3)x + 4 becomes -2x + 3y = 12, then 2x - 3y = -12 (making A positive). Standard form is particularly useful for finding intersections of lines, as it naturally sets up systems of linear equations that can be solved with Cramer's rule or elimination methods.
How do you find where a line crosses the x-axis and y-axis?
The y-intercept is found by setting x = 0 in the equation and solving for y. In slope-intercept form y = mx + b, the y-intercept is simply b, giving the point (0, b). The x-intercept is found by setting y = 0 and solving for x. From y = mx + b: 0 = mx + b, so x = -b/m, giving the point (-b/m, 0). For vertical lines x = k, the x-intercept is k and there is no y-intercept (unless k = 0). For horizontal lines y = k, the y-intercept is k and there is no x-intercept (unless k = 0). These intercepts are fundamental for graphing and provide immediate physical meaning in many applications.
What is a direction vector of a line?
A direction vector is a vector that points along the line, indicating its direction. For a line through points (x1, y1) and (x2, y2), the direction vector is (x2-x1, y2-y1) or any scalar multiple of it. The unit direction vector normalizes this to length 1 by dividing by the magnitude. Direction vectors are fundamental in parametric equations of lines: P = P1 + t*d, where d is the direction vector and t is a parameter. The normal vector is perpendicular to the direction vector and is useful for calculating distances from points to lines. In 3D geometry, direction vectors become even more important as they define lines uniquely along with a point.
How do you determine if three points are collinear?
Three points are collinear (lie on the same line) if and only if the slope between any two pairs of points is the same. Given points A(x1,y1), B(x2,y2), C(x3,y3), they are collinear if (y2-y1)/(x2-x1) = (y3-y1)/(x3-x1). To avoid division by zero, use the cross-product test: the points are collinear if (x2-x1)(y3-y1) - (x3-x1)(y2-y1) = 0. This is equivalent to checking that the area of the triangle formed by the three points is zero. Another method is to find the equation of the line through two points and verify that the third point satisfies it. Collinearity testing is important in computational geometry and data validation.