// July 2002, java applet by Oliver Knill for the CCP project // Green's Theorem and the Planimeter by Oliver Knill and Dale Winter // Harvard University, Nov 15, 2002. See // http://math.duke.edu/education/ccp/materials/mvcalc/green // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License of the Free Software Foundation for // details. Compile with // javac -O instrument.java comment.java wheel.java curve.java planimeter.java import java.lang.Math; import java.awt.*; class comment { private int tx,ty; // position of the text private int tx2,ty2; // position of the text private int n0; // integers private int n0_old=0; // integers public comment(int width,int height) { tx=12; ty=70; tx2=450; ty2=450; } public void update( Graphics g,double sum1 ) { Font f = new Font("Helvetica",Font.BOLD,12); g.setFont(f); n0=(int) (Math.abs(sum1))/10; g.setColor(new Color(0,0,0)); g.drawString(""+n0_old,tx,ty); g.setColor(new Color(255,0,255)); g.drawString(""+n0,tx,ty); Font f2 = new Font("Helvetica",Font.BOLD,24); g.setFont(f2); n0=(int) (Math.abs(sum1))/10; g.setColor(new Color(0,0,0)); g.drawString(""+n0_old,tx2,ty2); g.setColor(new Color(255,0,255)); g.drawString(""+n0,tx2,ty2); n0_old=n0; } }