When you ask Why is sin = Y and cosine = X? I read your question as Why is the function that gives me the Y axis called "sin" and why is the function that gives me the X axis called "cosine"?, so I'll start by answering that...
At its heart, it is a naming convention. If you have a unit circle with the common trigonometric functions...
... you'll see that all the function that go to the Y axis are "co" something (cosine, cosecant, cotangent).
Looking at the same unit circle you will find that
sin(θ) will give the X and Y coordinates respectively for the point on the unit circle that is at
θ angle from the X axis.
These functions where historically defined in terms of circles, in fact they come from the Sanskrit
Jyā (sine) and
koti-jyā (cosine), which where the names of those functions used by Indian mathematicians circa 500 AD. They were later translated to Latin, and from there to English. But, you don't care about that, you care about making games (or solving math problems, or whatever)!
Why is the circle represented as 1,1 and -1,-1?
It is a unit circle, that means that it is a circle with radius = 1, and thus it reaches down to -1 and up to 1. The reason why they use radius = 1 is because this makes it easy to scale the functions to a different radius.
And why is Y = sin and X = cos?
You may wonder why they aren't the other way around. Well, they had to be one way or the other, and whichever it was you would be asking the same... so the answer is: for historic reasons.
And through this tan = cos/sin?
No, this is WRONG. Actually
tan(x) = sin(x) / cos(x).
I hope to demostrate this in an intuitive manner. To start let's take the 0BC triangle from the image above:
I have added
cos in the triangle for ease of reference (
sec was removed because we don't need it).
We can see this triangle is a Right Triangle, and also that it contains another smaller Right Triangle. Furthermore, both triangles have one angle with the value
θ, therfore they are Similar Triangles. Which means that we can map one triangle over the other by only scaling, rotating and translating (moving). This can be seen in the following animation.
In the animation we used rotation and scaling, neither of these transformations changes the angles of the triangles.
Pay attention to what segment was mapped over what segment during the transformation. In particular:
- The magenta segment (
tan(θ)) was mapped over the black segment (
- The olive segment (
sin(θ)) was mapped over the green segment (
Now, let's see what does that mean.
tan(θ) went to
1. Meaning that
scaling_factor * tan(θ) = 1
scaling_factor = 1 / tan(θ)
So the scaling factor is
1 / tan(θ).
sin(θ) went to
cos(θ). Meaning that:
scaling_factor * sin(θ) = cos(θ)
By replacing the scaling factor we have:
1 / tan(θ) * sin(θ) = cos(θ)
sin(θ) / tan(θ) = cos(θ)
sin(θ) = cos(θ) * tan(θ)
sin(θ) / cos(θ) = tan(θ)
And that's what we were set to demostrate.