Awesome tutorial, lovely of you to make it @IKeudin!!
Great question @Rawrbear that line's
c value is the length of that side, I think it's related to something called Pythagoras' theorem though.
Hi @KVJ!! (I was in the middle of writing before you mentioned actually ) I realised just now after seeing this forum post that I'd made some diagrams on showing how to use the sine, cosine and tangent but never got to talk about them. Now would be a great time, yay!
This part is to help with understanding more about the basics of where sine, cosine and tangent come from. Let's look at a right-angled triangle:
This is a graph for the sine of angles from 0° to 360° :
I marked in sin(~37°) = 3/5, sin(30°) = 1/2 and a few more to illustrate
In Hopscotch you can move the graph up and down, make it wider or narrower and so on There are other great posts on that under sine and cosine tags
The same idea applies for cosine and tangent:
cos(angle) = A/H
Graph of cosine of angles from 0 to 360 degrees:
tan(angle) = O/A
Finally, this is a graph for the tangent of angles from 0 to 360 degrees. It's a little out of scale but tan(~37°)=3/4 and tan(45°) = 1 as some examples
So sine, cosine and tangent are related to the ratios of sides of a triangle
This originally started as an idea for an animation actually and I may as well have pointed to the [Intro to the trigonometric ratios video from Khan Academy] but here it is in readable form
That's to help with a basic understanding, using these trig ratios is a whole world in itself — look at all the awesome things people have created on Hopscotch
Just like you can graph sine and cosine of an object's x position, you can also graph tangent. The shape looks like this:
Link to basic tangent graph project
You can play around with the shape just like you can play around with the shape of a sine or cosine graph. In that project, I put these blocks:
The bubble with
+ 384 is the position where the graph will be centred, and the
5 is how steep the graph will go.
I wish I could explain more in more depth, but this is a wiki (not entirely sure on how they work yet) so feel free to add on anything! (I was running out of time when I introduced cosine and tangent, apologies ;( feel very free to elaborate there!)
I think I went a lot into the fundamentals but it's what I need to refer to, so maybe this can provide the basis when you need to refer to anything too
Whew that's super long. If you're looking at this for the first time, it may be confusing don't worry. Just like everything, you can take it bit by bit and the more you come across it, the more you'll remember each time