Any help on this would be greatly appreciated.
What is a Sine Wave Function and how can I use it in a view bobbing script?
1 answer
Sinusoidal Functions, also called Trigonometric Functions are functions that repeats its values in its periods, that is, at 2? radians or 360 degrees. Sinusoidal functions consists of six basic functions. They are Sine, Cosine, Tangent, Secant, Cosecant, and Cotangent`. These functions do not belong in polynomial functions category.
The general equation of a sinusoidal functions is.
f(x) = a sin [h (x - d)] + c, where
arepresents the vertical stretch / compression and reflection.hrepresents the horizontal stretch / compression and reflection.drepresents the horizontal displacement. Also called phase shiftcrepresents the vertical displacement
Periodic Functions always repeat a certain pattern. This means that after its interval, the graph repeats back to its beginning value. Consider the following example.
f(1) = 1
f(2) = 2
f(3) = 3
f(4) = 2
f(5) = 1
f(6) = 2
f(7) = 3
You can see that for every x value, there are 1 or more y-values. This is possible and a distinctive feature of a periodic functions.
Now, what you wanted was a sine graph. Below is an example of a basic sine graph functions.
f(x) = sin x
You can find the values for every y-values for the sine functions.
Using a graph paper, consider every grid to be 30 degrees. We can find the values for the sine values by creating a chart. This is using degrees.
| x - values | y = values |
|---|---|
| 0 | 0 |
| 30° | 1/2 |
| 60° | ?3/2 |
| 90° | 1 |
| 120° | ?3/2 |
| 150° | 1/2 |
| 180° | 0 |
| 210° | -1/2 |
| 240° | -?3/2 |
| 270° | - 1 |
| 300° | -?3/2 |
| 330° | -1/2 |
| 360° | 0 |
You will notice that the graph keeps on repeating from here on after. This happens because this is a periodic function. Now, as to why we keep on getting these values, consider this triangle.

We know that sine ? = opposite / hypotenuse. Using the primary trigonometric ratio, we can conclude the following:
sine 30 = x / 2x
sine 60 = x?3 / 2x
and so on.
To determine the values for greater than 90 degrees, we apply CAST Rule.

Since sine is positive in second quadrant, all the values from 90 degrees to 180 degrees is positive. Similarly, since sine is negative in III and IV quadrant, all the y-values are also negative.
I think this post is getting too long so I will leave you to study that by yourself. Or I might edit it later if I have time.
Now, you should have some general understanding on what sinusoidal functions are. Now it is your task to apply it to your problems. I do not know what bobbing script is.
Best of Luck.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
It's like an ocean wave but sine
To add onto incapaxx's message, it makes the perfect path for the head of the view bobbing script to follow
Perfect for surfing
To add onto incapaxx's message: cosine aswell
https://en.wikipedia.org/wiki/Sine_wave
Tip: Let the offset on the
yaxis besin(t)wheretis time.