# how to calculate wavelength of simple sine function

I have the following simple sine formula (in degrees) which I am plotting on the screen. The user is able to change the values of the variables waveAmplitude, angleCoef, and horizontalShift.

y = waveAmplitude * Math.sin(x * angleCoef + horizontalShift)


I have to also display the wavelength on the screen. But I can't quite figure out how to calculate the wavelength.

So how exactly can I calculate wavelength for my simple sine function?

• It is $2\pi$ divided by your 'angleCoef'. Try plugging this in for $x$ and see that it gives the same as when plugging in $x=0$. Your 'angleCoef' is usually called angular frequency. – M. Winter May 20 '17 at 15:57
• @M.Winter thank you. i edited to respond to your suggestion. – Jose Martinez May 20 '17 at 16:11
• Your plot is clearly indicating that your sine function is expecting radians and not degree. E.g. try 0.01, then $2\pi/0.01\approx 628.3$ which fits the plot. – M. Winter May 20 '17 at 16:19
• @M.Winter thank you!!! – Jose Martinez May 20 '17 at 16:23