Mike Buess
USA
3037 Posts |
Posted - 06/07/2005 : 12:44:56 PM
|
If your X values are evenly spaced you can used LabTalk's derivative function to draw your tangent. The following example assumes your worksheet is A(X), B(Y). Create col C(Y) to hold the tangent line and plot C in the same layer as B. If you want more than one tangent line you'll need a column for each.
kk=100; // draw tangent through point 100 yy0=col(B)[kk]; // y value at that point tmp=col(B); // create a temporary dataset from col B deriv tmp; // differentiate col(C)=0/0; // clear col C loop (ii,kk-10,kk+10) { col(C)[ii]=yy0+(ii-kk)*tmp[kk]; // create 10 points on either side of point kk }; del tmp; // delete temporary dataset
That won't work if your X values are unevenly spaced. In that case Origin C's Curve_derivative function might work. (I haven't tried.)
...Of course the temporary dataset (tmp) holds the derivatives at each point, which might be what you really need.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 06/07/2005 12:47:37 PM
Edited by - Mike Buess on 06/07/2005 12:49:05 PM
Edited by - Mike Buess on 06/07/2005 12:52:18 PM
Edited by - Mike Buess on 06/07/2005 3:24:08 PM |
|
|