Search for a tool
Linear Equation

Tool to calculate a linear equation from 1 or 2 points. The equation of a line is written ax + b with a, the direction coefficient (or slope) and b, the y-intercept.

Results

Linear Equation -

Tag(s) : Geometry, Functions

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Linear Equation' tool for free! Thank you!

Linear Equation

Linear Equation Calculator (2D plane)

From 2 points





From slope and 1 points




Answers to Questions (FAQ)

What is a linear equation? (Definition)

A linear equation is a mathematical relationship that describes a straight line in a 2D plane. It is usually in the form $ y = ax + b $ (or $ f(x) = ax + b $), where $ a $ and $ b $ are real numbers and $ x $ is the variable.

How to calculate the equations of a line?

The equation on the right, of the form $ a x + b $ (affine function), has 2 parameters: $ a $ its slope coefficient and $ b $ the ordinate at the origin.

Knowing the slope coefficient and the ordinate at the origin, is deduced the linear equation of the line.

Example: A line of slope coefficient 2 and intercept 3 has the equation $ 2x + 3 $

How to calculate slope coefficient?

From 2 points $ A(x_A, y_A) $ and $ B(x_B, y_B) $, the formula for the slope coefficient of the line or segment passing through the points A and B is the result of the fraction: $$ \frac{y_B-y_A}{x_B-x_A} $$

Example: A line passes through 2 points A(1,2) and B(3,4), the slope coefficient is $ \frac{4-2}{3-1} = \frac{2}{2} = 1 $

How to calculate the y intercept?

From the slope coefficient $ a $ and a point $ A(x_A, y_A) $, the computation formula of the y-intercept is the result $ b $ of the equation $$ a x_A + b = y_A $$

Example: A line with slope coefficient $ 3 $ goes through A(2,4), so $ 3 \times 2 + b = 4 \iff b = -2 $, so the y intercept is -2

How to find the equation of a line from two points?

It is possible to find the equation directly from the formula: $$ y = \frac{ (x - x_A)(y_B - y_A) }{ (x_B - x_A) } + y_A $$

How to find the equation of a line from one point and the slope?

For a point $ P = (x_1, y_1) $ and a slope $ S $, the calculation formula is: $$ y = S(x - x_1) + y_1 $$

Source code

dCode retains ownership of the "Linear Equation" source code. Any algorithm for the "Linear Equation" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Linear Equation" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Linear Equation" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Linear Equation" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/linear-equation
In a scientific article or book, the recommended bibliographic citation is: Linear Equation on dCode.fr [online website], retrieved on 2025-04-16, https://www.dcode.fr/linear-equation

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Linear Equation' tool for free! Thank you!


https://www.dcode.fr/linear-equation
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback