Basic Trigonometry

I also thought about adding example use cases of trigonometry in Roblox, but the thread has gotten very long already. Plus, this was more of an informational tutorial and my intention was to teach everyone about the concept, but people themselves chose when and where to use it. After all, programming and developing is your creative spin-off of what you learned. I mainly want to make sure that everyone does get a good understanding of this subject.

However, if it does become a requested thing, then I might consider making another tutorial talking about the application of trigonometry in Roblox. :wink:

3 Likes

Yes please do it. I’m interested to see how trigonometry can be applied in roblox.

4 Likes

If you do it, you will have all my respect

2 Likes

I’m sure I can think of countless ways to apply trig to developing on roblox, but I’m very curious to see what you’d come up with! I’ll be tracking this thread in hopes that you post more ways to apply it :wink:

Side note, awesome stuff!

1 Like

Heya! I myself am a newbie to the absolute beast that is trigonometry and I struggle myself with understanding it but I think I’ve grasped a bit of it to maybe help clear up some confusion(Anyone feel free to correct me if I’m wrong at any point in this post)

To start off Trigonometry focuses on the relationships within the sides and lengths of the right triangle and therefore can be used to solve for unknowns in the triangle.

I think trigonometry is just based on what you’re trying to find, and by using what you already know you can utilize the trigonometric functions to find an unknown value, it could be an angle or the length of a side…

Let’s say we have this right angle triangle:

Now let’s say we know what angle A is and we know what side a is and we’re trying to find side b, well then what should we do to find side b?

When doing trig depending on the angle you’re inputting into your function all your sides will be relative to that angle, what do I mean by this?

Well if we’re using angle A then the opposite side would be c because it is directly opposite from angle A and side b would be the adjacent side because it is adjacent to angle A, but Syh isn’t side a adjacent to angle A as well? good question but you see side a would be the hypotenuse, why you ask? because it is the side directly opposite to the 90 degree angle. So remember that.

Now, now that we know our angle and side, how do we find side b?, well since side b is adjacent to angle A we should use cosine (Cosine is Adjacent over Hypotenuse) or CAH for short.

We’re using cosine because we want to find the adjacent side, and since cosine returns the ratio of the adjacent side to the hypotenuse, since we know the length of the hypotenuse(side a) we could just multiply that ratio to return the actual length of the side we’re trying to find i.e side b… let’s demonstrate.

let’s plug cosine(A) into a calculator

our answer:

Alas my friends we have found our ratio value this is essentially b/a, but remember we didn’t know what b was, so now how do we find it?

Algebra version:
we can multiply our ratio by the side we know to find the side we want that’d look like this:

don’t mind the numbers they’re just showing the steps in sequential order
In step 3 we cancelled out side a from the equation and were left with b in step 4.

some people may not be strong at algebra so here’s a simplified version of us multiplying the ratio by the side a to find side b with the values:

and now as you can see we were left with this long decimal value, that is in fact side b.

So this is really just the basics I tried to break it down as much as possible so it could be easy to understand and as well as provide many visual examples.

The same concept for cosine applies for all the trigonometric functions, such as tan, sine, and cosine… later I might post a follow up on how to actually use and apply the inverse trigonometric functions such as asin, acos and atan, these functions are more widely used in game development due to their ability to find unknown angles which is really useful and important especially in game development.

8 Likes

Thanks this cleared up some of my confusion!

1 Like

Yes please make a tutorial as well :grin: :grin:

1 Like

Hey there! Awesome job with your go at trigonometry even though you’re new to it.

The only thing I have to mention is that you labeled the triangle a little incorrectly. The side that is c right now is supposed to be side a since it’s across from angle A. You just need to switch the current side a and side c. But, it really doesn’t matter much, I just I’d let you know as an FYI since that is the standard style of labeling triangles in trigonometry, you know?

1 Like

Wish there was an amazing resource like this 5 years ago

3 Likes

This is RealMathGeek approved!

3 Likes

This helped me a lot, thanks!
By the way, I think the answer for Question #2 in Practice #4 is wrong, as it is in radian. It should be 4.8 (or 4.9).
One thing I don’t get is Q#3 of Practice #4. I used the Law of Sines to find angle A an got 78, and 78 + 61 = 139. 180 - 139 = 41 for angle B. But you used the Law of Sines to find angle B first and got different answers?

1 Like

@cornman601
Hey!

For the mistake, good catch! It should be fixed now.

As per the second statement, I tried to solve it many times, and, yes the order did result in different answers. However, although it may seem like there are two correct answers, there is only one.

I actually have never come across this before and I just got lucky with the order. I plugged the values into a triangle solver and surely enough it’s my answer. I looked up why this happens, and the reason is that you have to use the Law of Sines on the smaller angle first. Remember: smaller side = smaller angle across from it. You should do this because sin-1 always returns a number <90 even if the angle is supposed to be obtuse (hence why you never got an obtuse angle). Meaning, if you put in the angle across from the longer side, you’ll get an incorrect answer in which the angle you get is acute when it’s supposed to be obtuse.

So, remember next time when you are given SAS (side angle side), after the law of cosine, use law of sine on the smaller angle (which is across from the smaller side). Then subtract from 180 like normal.

Read more here:

2 Likes

Oh, that makes alot more sense now. Thanks for helping me.

1 Like

Nice job, this is a pretty clear tutorial for basic trig. For people who are interested in taking it up a notch in trig, you can check out the ambiguous case (law of sines) and the hyperbolic trig functions - which I have seen used in Roblox scripts at times.

2 Likes

Great tutorial about trigonometry. Good job! :clap:

2 Likes

I’ve seen this especially useful in cframes, but also creating structural systems. For example, making conical rays that converge at one point but evenly disperse in the other direction.

If I see enough demand I may make a dedicated topic for trigonometry applications on Roblox. and maybe show come formations, like the conical rays

2 Likes

I love this tutorial, even though I didn’t understand most of it, keep the tutorials coming.

1 Like

i really like this :). it helped me remember all the basic trig that i learned before.

1 Like

You can learn everything about trigonometry on khan academy, on the app and the website

2 Likes

This was a very good tutorial, even tho this is an old post I learned alot from this! Thank you for creating this tutorial :+1:!

1 Like