Android app on Google Play

Linear function

Linear functions are functions of the form:

f(x)=m*x+b

the domain of which belongs to the set of real numbers \mathbbR.

and the codomain also belongs to the set of real numbers \mathbbR.

This formula is the is also call the straight line function, because its graph is a straight line.

The slope m

The constant m of a linear function is the slope or gradient of the function. It tells us how steep the line is, and if it is decaying or growing.

m < 0: The function is decaying

m > 0: The function is growing

m = 0: The function is constant

The constant b

The constant b indicates where the straight line intersects the y-axis. This will be in the point (0,b).

If b is 0, the function is said to be direct proportional, and its graph passes through the origin (0,0).

Calculation of m and b with two points given

If a straight line is passing through two points with the coordinates (x1, y1) and (x2, y2), the slope m can be calculated like this:

m=frac{y_2-y_1}{x_2-x_1}=frac{y_1-y_2}{x_1-x_2}

when m is known you can calculate b:

b=y_1-m*x_1=y_2-m*x_2

Linear growth

If x increases by 1, the change of y will be m.
If x increases by Deltax, the change of y will be m*Deltax..

This relationship is given by the formula:

Deltay=a*Deltax

Simple linear regression

If you have two sets of data, and you want to know, if there is a linear relationship between them, you can plot the data in a coordinate system and see if they fit into a straight line, or you can use a calculator to make the linear regression.

Finding the slope with an angle

If you know the angle θ between the x-axis and a line, you can calculate m of the linear function by using tangent:

m=tan(theta)

Calculate m and b of a linear function with two points given

Please enter the coordinates of two points.

Point 1
x1: y1:
Point 2
x2: y2: