sin and cos express length relations from an angle. Look at the formula and picture at https://en.wikipedia.org/wiki/Trigonometry#Overview
It says
sin A = a / c
Assume you know the angle A (say 45 degrees), and c (straight distance to B from A), you can compute a (height of B relative to A).
What may be throwing you off, is that you should see "sin A" as just another number (with a weird value). Let's add "s" to make this clear.
s = sin A
s = a / c
I only replaced "sin A" by "s" (and added a "s = sin A" so I don't loose the relation). Now if you look at the top line, we know "A", so we can compute "sin A", and we know "s".
Since 45 degrees is a well known angle, I know s is "sqrt(2)/2", ie just a number, only slightly more weird than 1, 4, 6, or 3.18.
Next is the bottom line. We know "s" (from the first line), we know "c" (let's say 100), so only "a" is not known, and this is the length of the line directly below B, ie the height we are looking for! So the line "s = a / c" must be shuffled around algebraically to read "a = ....", where "...." must only contain s and c. Since we know both s and c, we can compute the value of ..., and since "a = ...", we then also know the value of a.
This is where elementary algebra comes in. For this case, it says we should multiply both sides with c. We get "c * s = c * (a / c)", which is equal to "c * s = a", which is "a = s * c" (reading backwards). Apparently, ... above is "c * s", which is 100 * sqrt(2)/2, or 50 * sqrt(2), or about 50*1.4 (sqrt(2) is about 1.41), which is about 70 (computers can give you a more precise answer ).
As you can see, we are not so worried about the precise value of "sin A". It's just a value that gives the ratio between c and a for a given angle A.
Now try to compute the height of an airplane that you see at 60 degrees at 15km distance.
Another question is horizontal distance, how far do I have to walk such that I am directly under the plane (for simplicity, let's assume it doesn't move while I walk, or just flies tight circles, so it stays at position B). Hint: "sin A" won't work here.
About
Actually any point... Like I wanted for one situation a random point up to 100px from an enemy. The formula given to me to use was this..
pointX = enemyUnit.X + cos(random(360)) * random(100)
pointY = enemyUnit.X + sin(random(360)) * random(100)
As was pointed out in the other thread already, this won't work. The math is alright, it's just that "random" produces euhm... random results.
Let me rewrite to make it more clear.
angleA = random(360)
angleB = random(360)
distanceA = random(100)
distanceB = random(100)
pointX = enemyUnit.X + cos(angleA) * distanceA
pointY = enemyUnit.X + sin(angleB) * distanceB
As you can see in the first 2 lines, "random(360)" is performed twice. Each call gives a different answer. So, angleA may be "35", and angleB can be "243".
Similarly, distanceA may be 81, and distanceB may be 1.
So your X calculation uses a different angle and distance than your Y calculation.
It is probably not so bad here, as random movement is random movement, no matter how you derive it, but in other cases it may be more problematic.
To make it more consistent, draw one random angle, and one random distance, and use the same angle and distance both for X and Y calculation.
Also, check the documentation of your sin and cos functions. Some languages take degrees (which is what happens above), other languages use radians (in which case, divide the drawn angle by (2 * PI) ).
Degrees and radians both express angles of rotation, they just differ in scale. Degrees use 360 for one full rotation, while radians use about 6.28 (2 * PI). Radians make more sense from a theoretic point of view, for us they are just a little more weird than "nice" degree values