Calculate sin x using the following formula:
where t0 = x. To calculate the other terms in the sum, we use the following formula:
where ti is an arbitrary term, and ti+1 is the next term. For example:
import java.util.Random;
public class Main{
public void calculateSin(double x){
double t0=x;
double ti=new Random().nextDouble();
double ti1;
}
}
Comments
Leave a comment