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);
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);
Need Help?
We hope your visit has been a productive one. If you're having any problems, or would like to give some feedback, we'd love to hear from you.
For general help, questions, and suggestions, try our dedicated support forums.
If you need to contact the Course-Notes.Org web experience team, please use our contact form.
Need Notes?
While we strive to provide the most comprehensive notes for as many high school textbooks as possible, there are certainly going to be some that we miss. Drop us a note and let us know which textbooks you need. Be sure to include which edition of the textbook you are using! If we see enough demand, we'll do whatever we can to get those notes up on the site for you!