.
The slope formula, as you wrote it, works ALWAYS, for any function, not necessary linear.
If the function is linear, then the slope is the constant value along the entire straight line.
The slope formula is the same, and it defines the slope "m" of the straight line y = mx + c.
If the relationship is direct proportionality y = kx, it means that the straight line passes through the origin of the coordinate system.
The general formula for the slope works in this case too, and it defines the slope, which is exactly the coefficient proportionality "k" in this case.
Notice that in the last case = = k.
Did I answer all your questions?
If you want to ask something else, don't hesitate to send your questions to me through the "Thank you" form.
Happy learning !!