Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What is a Sine Wave Function and how can I use it in a view bobbing script?

Asked by
Foridex 46
4 years ago

Any help on this would be greatly appreciated.

0
It's like an ocean wave but sine User#24403 69 — 4y
0
To add onto incapaxx's message, it makes the perfect path for the head of the view bobbing script to follow beeswithstingerss 41 — 4y
0
Perfect for surfing User#24403 69 — 4y
0
To add onto incapaxx's message: cosine aswell theking48989987 2147 — 4y
View all comments (2 more)
0
Tip: Let the offset on the `y` axis be `sin(t)` where `t` is time. EpicMetatableMoment 1444 — 4y

1 answer

Log in to vote
0
Answered by
Zafirua 1348 Badge of Merit Moderation Voter
4 years ago
Edited 4 years ago

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, andCotangent`. 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

  • a represents the vertical stretch / compression and reflection.
  • h represents the horizontal stretch / compression and reflection.
  • d represents the horizontal displacement. Also called phase shift
  • c represents 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

!Image of Sine Functions 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.

!Special Triangles

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.

!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.

Ad

Answer this question