I hope the following applet is what you need.

Put one diagram on top of another does not look good, so I re-arrange it to left/right style.

You can drag the point in the f(x) diagram to change x when the simulated is in paused state.
You can drag the slider at right hand side to change y-scale.
More suggestions are highly welcomed!  To make it better. :-)

/htdocs/ntnujava/ejsuser/2/users/ntnu/fkh/tangentoffunction_pkg/tangentoffunction.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
Download EJS jar file(1332.1kB):double click downloaded file to run it. (26 times by 13 users) , Download EJS source (31 times by 10 users) View EJS source