lunes, 25 de mayo de 2009

Evaluacion




import java.applet.Applet;
import java.awt.*;
public class SennoApplet extends Applet {
public void paint(Graphics g){
g.drawString("y= m * Sen(ax+b)",400 , 300);
g.drawString("y= m * Cos(ax+b)",400 , 179);
g.drawString("y= (a*x+b) ",250 , 100);

g.drawLine(40, 40, 40, 450);
g.drawLine(20, 270, 450, 270);
g.setColor(Color.LIGHT_GRAY);

int a=1;
int m=100;
int b=0;

for(int i=0;i<361; i=i+2){
g.fillOval( a*(38 + i)+b,(int) (265 - m *(Math.cos(i*3.1416/180))),6,6);}

g.setColor(Color.red);

for(int i=0;i<361; i=i+2){
g.fillOval( a*(38 + i)+b,(int) (265 - m *(Math.sin(i*3.1416/180))),6,6);}

g.setColor(Color.blue);

for(int i=0;i<361; i=i+2){

g.fillOval( a*(38 + i)+b,(int)266-(a*i)+b,6,6);}


g.setColor(Color.BLACK);
g.drawString("-1", 30, 370);
g.drawString("0", 30,270);
g.drawString("1", 30, 165);
g.drawString("¶/2", 115, 280);
g.drawString("¶", 205,280);
g.drawString("3¶/2", 285, 280);
g.drawString("2¶", 405, 280);
g.drawLine(40,40,35,55);
g.drawLine(35,55,45,55);
g.drawLine(45,55,40,40);
g.drawLine(450,270,425,265);
g.drawLine(425,265,425,275);
g.drawLine(425,275,450,270);
g.setColor(Color.RED);
g.drawString("X (Radianes)", 460, 270);
g.drawString("Y f(x)", 25, 35);
int ymax=this.getHeight();
int xmax=this.getWidth();
this.setSize(600, 500);
}

1 comentario: