private double getSine(int t) {
double amplitude = 5.0;
double period = 20000 / 2 * Math.PI;
double sin = amplitude * Math.sin(t + period);
return sin;
}
private double getSine(int t) {
double period = 2 * Math.PI / 20000;
double sin = Math.sin(t / period);
return sin;
}
Then I do:for (int t = 0; t <=20000; t+=1000) {
double sin = getSine(t);
System.out.println (t + "\t" + sin);
}
public class MySine{
public MySine(){
for (int t = 0; t <=20000; t+=1000) {
double sin = getSine(t);
System.out.println (t + "\t" + sin);
}
}
private double getSine(int t) {
double period = (2 * Math.PI) / 20000.0;
System.out.println("number " + ( t* period));
System.out.println("number " + ( t*period));
double sin = Math.sin(t*period);
return sin;
}
public static void main(String [] args){
new MySine();
}
}
Title | # Comments | Views | Activity |
---|---|---|---|
What is JNDI datasource in spring | 1 | 38 | |
VB6 Compile Compatibility Issue | 4 | 40 | |
python question | 5 | 60 | |
Birthdays | 3 | 21 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!