Okay, my assignment is to produce an array values a sine wave with a custom frequency. This is my sine function:
Math.sin(frequency*(j/samplesPerSecond)*Math.PI*2)
j
is the array index and samplesPerSecond
equals 44100.
Now for an array of 100,000 values it returns 0.0 for the first 33,000, 1.571509...E-14 for the next 33,000 and 3.143018...E-14 for the rest.
I've tried System.out.println(Math.sin(Math.PI));
and it doesn't return 0 but it returns 1.224646...E-16
This is my first java assignment so I might be overlooking something really obvious here, but I'm really confused.