= #JxnPortable/docs/programmer_examples/demos/derivative_tangent_line_parametric_Demo.jxn ...

JxnRealArrayCurve.setLimiter(true)  ! remove outliers before scaling
!
slider = @JxnSliderPanel( $this )
it = slider.add( "it", 0., 0., length t - 1 )
!
gt = cos 2 PI t
ht = sin 2 PI t
xt = gt
yt = ht
gdot = -ht  ! =dg/dt
hdot =  gt  ! =dh/dt
yprime = hdot / gdot  ! =dy/dx
!
dt = 0.5
dx = gdot dt
dy = hdot dt
dyAlt = yprime dx  ! = ( hdot / gdot ) * gdot dt
! plot( t, dy - dyAlt )
!
xp = gt[it]
yp = ht[it]
xL = xp - dx[it]
xR = xp + dx[it]
yL = yp - dy[it]
yR = yp + dy[it]
plot( xt, yt ).add( @JxnGraphicsPainter( 0, xL, yL, xR, yR ).setColor(B) ).setAutoScale(1)
!
gder = derivative gt
hder = derivative ht
yxder = derivative( yt, xt )
plot( t, yxder, hder / gder, yprime ).setYBounds( -10, 10 ).setPlotFrameTitle( "yxder, hder/gder, yprime" )
plot( t, yxder - yprime ).setPlotFrameTitle( "yxder - yprime" )
plot( t, hder / gder - yprime ).setPlotFrameTitle( "hder/gder - yprime" )
plot( t, 250 gder / PI - gdot, 250 hder / PI - hdot ).setPlotFrameTitle( "250 gder / PI - gdot, 250 hder / PI - hdot" )