-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsinMsg.java
More file actions
33 lines (27 loc) · 1003 Bytes
/
sinMsg.java
File metadata and controls
33 lines (27 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public class sinMsg{
public static void main(){
long initialTime;
/**
* Working with frequency is fun:
* like if you set frequency to 3 it makes a DNA shape and if too high it forms a nice wave
*
* amp or amplitude can increase the displacement of wave from mean position.
*/
int amp = 16; double freq = 0.01;
String text = "Ishant Sharma";
int d;
for(double i = 0.1; i<=360; i+= freq){
d = (int) Math.round(Math.sin(i) * amp);
for(int j = -amp; j<= d; j++){
System.out.print(" ");
}
System.out.println(text);
// Remove the bottom code if you don't need animations
initialTime = System.nanoTime();
for(int k = 0; k==k; k=k){
if(System.nanoTime() > initialTime+Math.pow(10,7))
break;
}
}
}
}