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.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Line Equation From Two Points Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: y - y₁ = [(y₂ - y₁) / (x₂ - x₁)] × (x - x₁)
Worked example — y = 2x | Standard: 2x - y = 0 | Angle: 63.43°
Formula
y - y₁ = [(y₂ - y₁) / (x₂ - x₁)] × (x - x₁)
Calculate the slope m = (y₂ - y₁)/(x₂ - x₁) 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 y-intercept = 2 - 2(1) = 0 Slope-intercept: y = 2x Standard form: 2x - y = 0 Angle of inclination: arctan(2) = 63.43° Midpoint: (3, 6) Distance: sqrt(16 + 64) = sqrt(80) = 8.944
Result:y = 2x | Standard: 2x - y = 0 | Angle: 63.43°
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 y-intercept = 8 - (-2)(0) = 8 Slope-intercept: y = -2x + 8 Standard form: 2x + y = 8 x-intercept: x = -8/(-2) = 4 Perpendicular slope: 1/2 Midpoint: (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 perpendicular bisector and how is it calculated?
The perpendicular bisector of a line segment is the line that passes through the midpoint of the segment and is perpendicular to it. To find it: first calculate the midpoint M = ((x1+x2)/2, (y1+y2)/2), then find the negative reciprocal of the segment slope to get the perpendicular slope m_perp = -1/m. Finally, use the point-slope form with the midpoint and perpendicular slope. The perpendicular bisector has the special property that every point on it is equidistant from the two endpoints of the original segment. This property is fundamental in constructing circumscribed circles of triangles and in Voronoi diagrams used in computational geometry and spatial analysis.
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.
What is the distance from a point to a line?
The distance from a point (x0, y0) to a line Ax + By + C = 0 is given by d = |Ax0 + By0 + C| / sqrt(A² + B²). This formula gives the shortest (perpendicular) distance from the point to the line. To use this with slope-intercept form y = mx + b, rewrite as mx - y + b = 0, giving A = m, B = -1, C = b. For example, the distance from point (3, 4) to line 2x - y + 1 = 0 is |2*3 - 4 + 1| / sqrt(4+1) = 3/sqrt(5) = 1.342. This formula is used in optimization, fitting lines to data, and determining clearances in engineering design.
How are line equations used in linear programming?
In linear programming, constraints are expressed as linear inequalities (such as 2x + 3y <= 12), and each inequality defines a half-plane bounded by a line. The feasible region is the intersection of all these half-planes, forming a convex polygon. The optimal solution (maximum or minimum of the objective function) occurs at a vertex of this feasible region. Finding these vertices requires solving pairs of line equations simultaneously, which is precisely finding intersection points. Understanding line equations is therefore essential for formulating and solving linear programs in operations research, supply chain optimization, resource allocation, and production planning.
Can you find a line equation from a point and a slope?
Yes, if you know one point (x1, y1) and the slope m, you can immediately write the equation in point-slope form: y - y1 = m(x - x1). Then convert to any other form as needed. For slope-intercept form, expand and solve for y: y = mx + (y1 - m*x1), where b = y1 - m*x1 is the y-intercept. This approach is simpler than using two points because the slope calculation step is already done. It is commonly used when you know a line must be parallel to another line (same slope) or perpendicular (negative reciprocal slope) and passes through a given point. In calculus, this method constructs tangent and normal lines to curves at specific points.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator · Editorial policy
Related Calculators
🧮Regression Equation Calculator
Calculate the regression equation, R-squared, and prediction intervals from data points.
🧮Line of Intersection of Two Planes Calculator
Calculate line of intersection of two planes with inputs, formulas, and instant results.
🧮Distance Between Points Calculator
Calculate the distance between two points in 2D, 3D, or N-dimensional space.
🧮Coordinate Distance Calculator
Calculate distance between two points using the distance formula with step-by-step work.
🧮Concavity and Inflection Points Calculator
Calculate concavity and inflection points with inputs, formulas, and instant results.
🧮Absolute Value Equation Calculator
Calculate absolute value equation with inputs, formulas, and instant results.
🧮Cubic Equation Calculator
Calculate cubic equation with inputs, formulas, and instant results.
🧮Equation Balancer Calculator
Calculate equation balancer with inputs, formulas, and instant results.