2 files have been modified (TangentLine.java and WCMTangentLineBean.java from net.sourceforge.webcompmaths.draw and net.sourceorge.webcompmaths.draw.beans respectively), 2 have been created (Tan2.java and WCMTan2Bean.java from net.sourceforge.webcompmaths.draw and net.sourceorge.webcompmaths.draw.beans respectively).
Tan2 was created as a direct copy of DrawGeometric class with names changed (works as a kind of buffer so that code added will only affect drawing Tangents not anything else). It was found that the if statement in draw method that checks for variable d being NaN or infinite contained a return statement that was preventing tangents being drawn (the derivative at point x when we expect a vertical line will be undefined). To correct this i first commented out the return statement. This was found to not be enough. within the if statement variable c was set to equal 0 and d was set to 1. this addition allows a vertical line to be drawn in the case caught by the if statement. For Tan2 to be used we must change the extend statement in TangentLine.java to Tan2 instead of DrawGeometric. The code within Tan2 not needed for drawing just tangents was then removed to reduce size of file. These changes were then tested using the Derivtives applet and SecantTangent applet with success.
Further to this changes needed to be made for the java Beans since certain applets require them. WCMTangentLineBean was set to extend WCMTan2Bean. Then WCMTan2Bean.java was then added and code from WCMDrawGeometricBean was copied into it again replacing WCMDrawGeometricBean occurences to WCMTan2Bean and DrawGeometric to Tan2 (also in import statement). This was then checked by exporting the files and testing with Transforms Calculus applet with success.
files modified are attached as a rar archive
s0673384@sms.ed.ac.uk