// 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. import java.lang.Math; import java.awt.*; class curve { public int h,w; // width and height taken over private int cx1, cy1; // previous plot point private int cx2, cy2; // next plot point private int interpolation=400; // number of interpolation points private int re,gr,bl; // red, green, blue private int re0,gr0,bl0; // red, green, blue private int i; // index private double twopi=6.283185307; // constant 2*pi public curve(int width,int height) { this.w = width; this.h = height; } public void draw_dot(Graphics g, int red, int green, int blue, int center_x,int center_y,int dot_size) { g.setColor(new Color(red,green,blue)); g.drawOval(center_x-dot_size,center_y-dot_size,2*dot_size,2*dot_size); } public void draw_text(Graphics g, int red, int green, int blue, int center_x,int center_y, int size,String text) { g.setColor(new Color(red,green,blue)); Font f = new Font("Helvetica",Font.BOLD,size); g.setFont(f); g.drawString(text,center_x+10,center_y); } public void draw_poteto(Graphics g, int red, int green, int blue, int center_x,int center_y, int scale_x,int scale_y,String text, int dot_size) { g.setColor(new Color(red,green,blue)); for (i=0; i