I cannot figure out your "method". In my opinion the shortest-way to calculate the gradient of a 'straight-line' joining points (X1,Y1) and (X2,Y2) is:Dear Experts, the following question addresses finding the gradient of line B.. While my method works, I suspect there might be a shorter and less time-consuming approach. Is there an alternative method, such as using the tangent function (tan(theta)), to achieve the same result?
View attachment 38064
Thank you for your response to my post. I'm actually looking to determine the function of line "B" in my picture, with the intention of applying the Fourier series.I cannot figure out your "method". In my opinion the shortest-way to calculate the gradient of a 'straight-line' joining points (X1,Y1) and (X2,Y2) is:
Gradient = (rise)/(run) = (Y2 - Y1) / (X2 - X1)
For the problem shown (X1 = 0, X2 = 2, Y1 = 0 and Y2 = 2)
Gradient = (X2 - X1) / (Y2 - Y1) = (2 - 0) / (2 - 0) = 2/2 = 1
You wrote:Dear Experts, the following question addresses finding the gradient of line B.. While my method works, I suspect there might be a shorter and less time-consuming approach. Is there an alternative method, such as using the tangent function (tan(theta)), to achieve the same result?
View attachment 38064
Apparently you misstated your goal, and you did want the equation, not just the gradient.Thank you for your response to my post. I'm actually looking to determine the function of line "B" in my picture, with the intention of applying the Fourier series.
I employed the method of calculating the difference in Y-coordinates divided by the difference in X-coordinates.
You wrote:
The RHS of this is the gradient (also called the slope). The LHS is nonsense; and on the third line, you seem to transmute it (illegally) to what it should have been if the goal was to derive the equation of the line:
This equation says that the gradient from [imath](x_1, y_1)[/imath] to [imath](x, y)[/imath] is the same as the gradient from [imath](x_1, y_1)[/imath] to [imath](x_2, y_2)[/imath].
But you don't need to find the equation of the line (in the form [imath]y = mx + b[/imath]) to find the slope; you already had the slope as soon as you wrote -1/2.
Apparently you misstated your goal, and you did want the equation, not just the gradient.
For that, there is a somewhat easier way: First find the gradient (-1/2), and then use the point-slope form, [imath]y-y_1=m(x-x_1)[/imath], using the gradient just found, and either of the two known points.
You certainly don't need the tangent of an angle that you don't know.
When you say "Thanks in advanced", I believe you mean "thanks in advance", meaning, before I actually do what you are thanking me for.Dear Sir, I greatly appreciate your support and advice. While it's much clearer now the mistakes that I have done. I'm still a bit confused about finding the line function easily without directly substituting values into y = mx + c, despite watching the tutorials provided on the webpage.
Thanks in Advanced