The last thing I want to talk about today is another powerful mathematical function
that we can use a lot enjoying, and, the, these functions are, trigonometry which
he, probably studied in high school or the equivalent.
and they are three functions that relate to triangles.
relate angles and triangles. So, if we look at the slide here, we've
got a right angled triangle. We've got an angle A in that triangle,
and then we can label the sides. The adjacent side, which means the side
that's next to the angle. The opposite side, ones opposite it.
And the hypotenuse, which is the long the long angle, the long side of the
triangle. And this trigonometric functions are
defined in terms of these three sides. The sine of an angle is the opposite side
to that angle divided by this hypotenuse, the length of the opposite side divided
by the hypotenuse. In the case of the tangent, it's also
defined the same way. Now, we're not actually going to use
these to work with angles or triangles, and I'm going to show you something
different. I'm actually just interested in working
with sine as a function, because it's a really instant function.
And it's really powerful for doing graphics animation, and I'm going to show
you what it does. So, if we're drawing the circle, you can
that the vertical line in the circle is the opposite of the angle in the middle
of the circle as we rotate around. So, we can see we're drawing a circle,
and I'm tracing out the path of the actual sine function at the same time as
drawing the circle. And you can see, is that when the angle
is. When it starts again, it's near zero, the
sine function zero. It gets increasingly more negative, then
increasingly more positive. And then it goes back down to zero again,
and it starts the way around a circle. So, it repeated itself exactly, going
negative, going positive again. And what's powerful about is that it's
repetitive oscillating function. So, it goes up and down, up and down, up
and down all the time. It looks a little bit like a wave.
In fact, it's a very important mechanism for modeling sound wave.
Sound waves act a lot like sou, sine waves.
In fact, we can build up any sound wave out of a whole load of si, of si, of sine
functions of different sizes and frequencies.
So, what do we, what can we do with this? Well, before we come to that, I'll talk a
little bit more about the function. So, this is More detail about the sine,
sine function, this is how we would write it out.
we're using the function sine, which is the calculates the sine of an angle, but
we're putting some other numbers in. Firstly t, we can think of this as time,
if you're working with animation with sounds, the sine function is changing
over time. Then we've got, we multiply the result by
A. That's called the amplitude, that's how
high it gets and also how low it gets. That's how big the sine wave is.
In audio, that is closely related to the volume of audio.
If you take, if you're listening to sound.