# Finding the Straight Line Equation for Diagraming and Graphing

In this post, we will find the straight line equation for diagraming and graphing with given some information about it. The information might comprise the gradient’s value as well as the coordinates of a point on the line. Alternatively, the data might represent the coordinates of two distinct places on the line. There are various methods to represent the final equation, some of which are more generic than others.

To master the principles described here, you must perform several practice sessions until they become second nature. After reading this post, you will be able to find the equation of a straight line given its gradient and intercept on the y-axis along with finding the equation of a straight line given its gradient and one point lying on it.

Moreover, you will be able to find the equation of a straight line given two points lying on it as well as the equation of a straight line in either of the forms y = mx + c or ax + by + c = 0.

## Equations of Straight Lines

This post is about straight line equations. Depending on the data we know about the lines, these equations can take many shapes. To begin, imagine we have a straight line that connects the locations in the following list.

There are many more points on the line, but we can discern a pattern now. Any x number multiplied by 2 yields the matching y value: 0 + 2 = 2, 1 + 2 = 3, 2 + 2 = 4, and so on. The x and y coordinates of each point on the line have a constant connection, and the equation y = x + 2 is always valid for points on the line. Using this equation, we can label the line.

### A straight line across the origin with a specified gradient

Assume we have a line with the equation y = x. The y-coordinate must then be equal to the x coordinate for every point on the line. As a result, the line will include the following points.

We may calculate the gradient of the line using the gradient formula, m = y2 – y1 / x2 x1, and insert the first two sets of data from the table. We obtain m = 1 – 0 / 1 – 0 = 1, which means that the gradient of this line is 1. What about the formula y = 2x?

This also symbolizes a straight line, and each y value for each point on the line is double the corresponding x value. As a result, the line will include the following points.

Calculating the gradient of the line y = 2x using the first two sets of data in the table yields m = 2 – 0 / 1 – 0 = 2, indicating that the gradient of this line is 2. Consider the equation y = 3x. This also symbolizes a straight line, and each y value for each point on the line is three times the corresponding x value. As a result, the line will include the following points.

Calculating the gradient of the line y = 3x using the first two sets of data in the table yields m = 3 – 0 / 1 – 0 = 3, indicating that the gradient of this line is 3.

We’re starting to notice a pattern here. All of these lines contain equations in which y is equal to some integer multiplied by x. In each case, the line passes through the origin, and the gradient of the line is determined by multiplying x by a number.

So, if we had a line with the equation y = 12x, we would anticipate the gradient to be 12. Likewise, if we had a line with the equation y = 2x, the gradient would be 2. In general, the equation y = mx indicates a straight line with gradient m that passes through the origin.

### Finding Equation of Straight Lines using two Points

What should we do if we wish to get the equation of a straight line that connects the points (1, 2) and (2, 4)? We don’t know the gradient of the line here, so it appears that we can’t utilize any of the equations we’ve found thus far. However, we do know two points on the line and can use them to calculate the gradient. We just apply the formula m = (y2 – y1)/(x2 – x1). We get,

m = 4 – 2 / 2 – (-1) = 2 / 3.

As a result, the gradient of the line is 2/3. And since we have two locations on the line, we can utilize one of them in the equation y – y1 = m(x – x1). Taking the point (2, 4),

y – 4 = 2/3 (x – 2)

3y – 12 = 2x – 4

3y = 2x + 8

y = 2/3(x) + 8/3

A slope intercept form calculator can assist you in finding the equation of a straight line using two points, one point and slope, and y-intercept and slope as well.

### The slope of a line with y-intercept

Take a look at the straight line with the equation y = 2x + 1. This equation differs somewhat from the others we’ve examined so far. We need to compute certain numbers before we can make a drawing of the line.

It is worth noting that when x = 0, the value of y equals 1. As a result, this line intersects the y-axis at y = 1. What about the formula y = 2x + 4? We can compute certain values once again.

At y = 4, this line intersects the y-axis. What about the equation y = 2x – 1? We can compute certain values once again.

At y = 1, this line intersects the y-axis. A straight line’s general equation is y = mx + c, where m is the gradient and y = c is the value at which the line intersects the y-axis. On the y-axis, this quantity c is known as the intercept.

The equation of a straight line is occasionally given to us in a different form. Assume that we have the equation 3y – 2x = 6. How can we demonstrate that this is a straight line and get its gradient and intercept value on the y-axis? We may apply algebraic rearrangement to get the equation y = mx + c.

3y – 2x = 6, 3y = 2x + 6, y = 2/3 x + 2.

So, now that the equation is in standard form, we can see that the gradient is 2/3 and the intercept value on the y-axis is 2. We can also work in reverse. Assume we know a line with a gradient of 1/5 and a vertical intercept at y = 1.

To solve the problem, just plug the relevant numbers into the basic formula y = mx + c. Because m = 1/5 and c = 1, the equation is y = 1/5 x + 1. If we wish to eliminate the fraction, we may write the equation as 5y = x + 5, or 5y – x – 5 = 0.

### Equation of straight line passing through a given point with given gradient

Assume we wish to calculate the equation of a line with a gradient of 1/3 and that passes through the point (1, 2). While we know the gradient in this case, we don’t know the value of the y-intercept c. To begin, consider the general equation of a straight line, y = mx + c. We know the gradient is 1/3 and can immediately swap this number for m.

This results in y = 1/3 x + c. We are now making use of the fact that the line runs through (1, 2). This indicates that y must be 2 when x = 1. Substituting these numbers yields:

2 = 1/3(1) + c,

Resulting in,

c = 2 – 1/3 = 5/3.

The equation of a straight line passing between two specified points is y = 1/3 x + 5/3.

There is a myth that a circle or arc cannot be converted into a straight line. A circle or an arc can be converted into a straight line by cutting it at any point on the circumference. The length of an arc can be calculated using an arc length calculator.

## Final Words

We have explored several ways in which equations of straight lines can be established. It can be calculated using two points, y-intercept and slope, and one point and slope, as well. The general equation of a straight line can be expressed as ax + by + c = 0 which is needed in some cases.