sábado, 24 de octubre de 2009

Seno, Coseno y valor de e

Este programa calcula el seno, coseno y el valor de e

Main.java

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package deberfunciones;

/**
*
* @author usuario
*/
public class Main {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}

}

TablaFunciones.java

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author usuario
*/
public class TablaFunciones {
public static void main(String args []) {
double x;
double ep;
double y;
double m=0.0;
while(m < 10){
System.out.println("m = "+m);
m+=0.1;
x = Math.sin(m);
System.out.println(" sin ="+x);
x=Math.cos(m);
System.out.println(" cos ="+x);
ep=2.7183;
for(y = 0; y <= 10;y = y+0.1){
System.out.println((Math.pow(ep,y))*(Math.cos(y)));

}
}
}
}

No hay comentarios:

Publicar un comentario