Equation of Line Calculator

Choose an input method and enter values easily. View every equation form and key metrics. Download results, share work, and verify homework accurately fast.

Inputs
Pick a method, enter values, then calculate
You may type fractions like 3/4.

This uses: x/a + y/b = 1 (requires nonzero intercepts).
Slope is tan(θ). Angles like 90° produce a vertical line.
Parallel keeps the same slope. Perpendicular uses m₂ = −1/m₁, with vertical/horizontal handled automatically.
Optional evaluation
Compute y for a chosen x, and/or compute x for a chosen y.
Example data
Sample inputs and what the calculator will return
Method Inputs Equation (slope-intercept) Standard form
Two points (1,2) and (3,6) y = 2x 2x - y + 0 = 0
Point & slope Point (4,1), m = -1/2 y = -0.5x + 3 x + 2y - 6 = 0
Standard 3x + 2y - 8 = 0 y = -1.5x + 4 3x + 2y - 8 = 0
Note: output formatting depends on your precision and fraction options.
Formula used
Key relationships used to build the line equation
  • Slope from two points: m = (y₂ − y₁)/(x₂ − x₁), when x₂ ≠ x₁.
  • Two‑point standard form: (y₁ − y₂)x + (x₂ − x₁)y + (x₁y₂ − x₂y₁) = 0.
  • Point‑slope form: y − y₁ = m(x − x₁).
  • Slope‑intercept form: y = mx + b where b = y₁ − mx₁.
  • Standard form: Ax + By + C = 0 gives m = −A/B (if B ≠ 0) and b = −C/B.
  • Intercept form: x/a + y/b = 1 converts to bx + ay − ab = 0.
  • Angle method: slope is m = tan(θ); if cos(θ)=0 the line is vertical.
  • Parallel / perpendicular: parallel keeps slope; perpendicular uses m₂ = −1/m₁, with vertical/horizontal handled as special cases.
  • Distance from origin: for Ax + By + C = 0, distance is |C|/√(A² + B²).
How to use this calculator
  1. Select a method that matches your known information.
  2. Enter the required values (fractions like 5/3 are allowed).
  3. Adjust precision or choose fraction‑preferred output if needed.
  4. Click Calculate to view results above the form.
  5. Use the download buttons to export results as CSV or PDF.

Input methods and required fields

This calculator accepts two points, point–slope, slope–intercept, intercepts, standard form, angle with a point, and parallel or perpendicular constraints. Each method reduces to Ax + By + C = 0, which is stable for vertical lines where B = 0.

Slope, direction, and change rates

For non‑vertical lines, slope m = −A/B measures rise per unit run. If m = 2, y increases by 2 for every 1 unit increase in x. If m = −0.5, y falls 1 unit for every 2 units of x. The direction vector (B, −A) shows the line’s travel direction, useful for parametric motion and vector geometry.

Intercepts and equivalent equation forms

The x‑intercept occurs at y = 0, giving x = −C/A when A ≠ 0. The y‑intercept occurs at x = 0, giving y = −C/B when B ≠ 0. Slope‑intercept form y = mx + b is ideal for quick substitution, while point‑slope y − y₁ = m(x − x₁) is often preferred in proofs and coordinate geometry.

Angle, parallel, and perpendicular constraints

When an angle θ is provided, the slope is tan(θ), and the tool treats 90°‑type angles as vertical. Parallel lines preserve slope, while perpendicular lines use m₂ = −1/m₁; a horizontal reference automatically yields a vertical result, and vice‑versa. These rules support construction problems in analytic geometry.

Quality checks and numeric controls

Precision settings manage rounding for display, while fraction input such as 3/4 is converted reliably for computation. Standard‑form normalization can scale coefficients to small integers, improving readability in assignments and reports. The distance from the origin uses |C|/√(A² + B²), a common metric for comparing offsets between multiple candidate lines.

Plot, exports, and verification workflow

The Plotly graph displays the computed line and key points, letting you validate slope direction, intercept placement, and vertical behavior visually. Use the optional evaluation fields to compute y at a chosen x (or x at a chosen y) for spot checks. Export CSV for spreadsheets or PDF for submission, keeping the equation forms and derived metrics consistent across tools. For homework, paste the standard form into graphing apps, then confirm the plotted line passes through your inputs. Save screenshots to document your checks every time.

FAQs

1) What happens when the line is vertical?

Vertical lines have no finite slope. The calculator reports the equation as x = k and still provides standard form, direction/normal vectors, and a correct Plotly visualization.

2) Can I enter fractions like 7/3?

Yes. Fractions and decimals are accepted in all numeric fields. The tool converts them for computation and can display results as fractions, decimals, or both depending on your settings.

3) Why do I see different standard-form coefficients?

Many equivalent standard forms represent the same line. Enabling normalization scales coefficients to smaller integers and applies a consistent sign rule, improving readability while preserving the identical geometric line.

4) How are perpendicular lines calculated?

For non‑vertical lines, the perpendicular slope is m₂ = −1/m₁. If the reference is horizontal, the perpendicular becomes vertical. If the reference is vertical, the perpendicular becomes horizontal.

5) What does “distance from origin” mean?

It is the shortest distance from (0,0) to the line. For Ax + By + C = 0, the distance equals |C|/√(A² + B²). It helps compare how far different lines sit from the origin.

6) How should I use CSV and PDF exports?

Use CSV to store results in spreadsheets, share datasets, or run checks across multiple problems. Use PDF for print-ready submission, keeping the computed equation forms and key metrics together.

Built for clean, printable results on a white layout.

Related Calculators

radical equation solverabsolute value equation solvergrowth decay calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.