hi,
thanks...what packages i have to include to use Math.sin ..and how do i plot it in an applet?
Also...you said you will use (int)value for coverting double to integer? so you would use something like this? (int variable1)variable2?
where variable2 is double?
thanks again...
You are going to want to override Applet's paint() method and put all your code in there. Become familiar with java.awt.graphics. Also, you are going to want to convert the function coordinates to the dimensions of your applet. The domain of the period of f(x)=sin x is [0,2*pi] and the range is [-1,1]. You are going to want the width of your applet to represent the domain and the height to represent the range. It's a simple multiplication and division trick. Just get some paper and work it out.
To convert a double to an integer you are going to cast it to an int. The cast will return an int value. Here's how it works.
double d = "123.456" ;
int i = (int) d ; // <- casts "d" to an int and returns, stores int in "i"