Hi,
I have four X Points(x0,x1,x2,x3) and corresponding Y Points(y0,y1,y2,y3), A Curve can be connected using these points, I want to find tangent of this curve. How do I get this or what is method I suppose to use.
Thanks in Advance,
Pandi K
Hi,
I have four X Points(x0,x1,x2,x3) and corresponding Y Points(y0,y1,y2,y3), A Curve can be connected using these points, I want to find tangent of this curve. How do I get this or what is method I suppose to use.
Thanks in Advance,
Pandi K
What do you mean by find the tangent?
I'll assume you mean gradient and start with finding the gradient of the tangent.
The gradient of the tangent can be found with $\displaystyle \frac{y2-y1}{x2-x1}$, where y2 is the biggest y-coordinate you have ( which is 3 in your case ) and y1 is the smallest y coordinate you have. Same thing applies for X2 and X1. So sub all values in, you should end up with $\displaystyle \frac{3-0}{3-0}$ and therefore the gradient of the tangent is 1.
THE "tangent to a curve" makes no sense. A curve may have a different tangent at any point. And, of course, because there are an infinite number of functions, even "differentiable" functions or even polynomials, that pass through four given points, there is no way of knowing which is meant or at which point you want the tangent. That's why Tutu gives you the slope of the secant line through the two endpoints. However, he makes the error of assuming that by "$\displaystyle x_0, x_1, x_2, x_3$" and "$\displaystyle y_0, y_1, y_2, y_3$" you mean that x=0 and y= 0; x= 1, y= 1; x= 2, y= 2; x=3, y= 3 so that your points all lie on the straight line y= x.
Given four distinct points, $\displaystyle (x_0, y_0)$, $\displaystyle (x_1, y_1)$, $\displaystyle (x_2, y_2)$, and $\displaystyle (x_3, y_3)$, the simplest thing to do, although not the only answer, is to find the unique cubic function that passes through those points: that is, find $\displaystyle y= ax^3+ bx^2+ cx+ d$ so that $\displaystyle y_0= ax_0^3+ bx_0^2+ cx_0+ d$, $\displaystyle y_1= ax_1^3+ bx_1^2+ cx_1+ d$, $\displaystyle y_2= ax_2^3+ bx_2^2+ cx_2+ d$, and $\displaystyle y_3= ax_3^3+ bx_3^2+ cx_3+ d$. Solve those four equations for a, b, c, and d. Then the slope of the tangent line at any point at x is given by $\displaystyle y'= 3ax^2+ 2bx+ c$. That allows you to find the tangent line at that particular point to that particular curve.