java Code for Sine Curve using Taylor Series Formula
import java.awt.*; public class TaylorSin extends java.applet.Applet { public int factorial (int num) { int n=num; for (int i=1; i < num; i++) { n=i*n; } //System.out.println("Factorial of " + num + " is "+ n); return n; } public double Sinus(double b) { double j = ((Math.pow(b,5))/factorial(5)); double g = ((Math.pow(b,3))/factorial(3)); double h = ((Math.pow(b,9))/factorial(9)); double f = ((Math.pow(b,7))/factorial(7)); double z= b-g+j-f+h; System.out.println("Sin of "+ b +" is " + z); return z; } public double equn(int a) { double y = 300+(300*Sinus(a/500.0)); return y; } public void paint(Graphics g) { int x; for(x = 1; x < 1366; x++) { double y = equn(x);