Sign in to follow this  
JeremyB

Basic Trigenometry Question

Recommended Posts

After a long break from math I started taking another crack at it. I'm not sure I'll ever get to this graphical stuff, but I'm sorting through a trigonometry link.

 

https://www.raywenderlich.com/35866/trigonometry-for-game-programming-part-1

 

What is getting me is that you need to know something about the triangle to deduct the information. How do you gather intel, if you don't know anything about it.

 

Two sprites on the screen, you have no idea what points they're at. How on earth do you do trigonometry with a blank triangle?

Edited by JeremyB

Share this post


Link to post
Share on other sites

You are correct: You cannot do trig without some given information.

 

Having right triangles, as opposed to just any sort of triangle gives you a head start because you know that one angle is 90 degrees. If you know that the sum of the angles is 180 degrees then you only need one more angle to know all three angles. But, if you don't know that second angle, you'll never know the third unless perhaps you have some other piece of information like the length of a side which can be used to give you a second angle.

 

But Alvaro makes a good point; you should know where they are on the screen since it's your code that puts them there.

Share this post


Link to post
Share on other sites

Thanks guys. The information was helpful, and what I thought. I learned some vector math, just adding, subtracting, scalar multiplication. Things are coming clear. : )

 

Not quite trig here, but I'm having a little problem plotting a circle. I see the formula:

 

(x-h)2 + (y - k)2 = r2
 

Where h and k have something to do with the center of the circle. That's where my understanding is ending, even with videos I watch. For some reason, no one is going over the variables. is h and k x and y coordinates of the center point, if so which? Also if they are the center points what is x and y in the formula?

 

Sometimes the videos and sites could be a lot more helpful, lol.

Edited by JeremyB

Share this post


Link to post
Share on other sites

That's where my understanding is ending, even with videos I watch.

This is because you probably don't know Pythagoras' theorem, which is not a big deal, because if you want, you can understand it pretty easily, I'm sure. You just need to spend some time on it.

 

Normally, if there is something you can't grasp, it's not that the problem is inherently hard, it's just that you are trying to grasp 2+ things at once, and you count it as one problem.

 

And to answer the question:

 

is h and k x and y coordinates of the center point, if so which? Also if they are the center points what is x and y in the formula?

I will just show you a graph, you need to figure everything on your own. Imagine that 'h' and 'k' are substituted with 'a' and 'b' in your formula.

 

graph-circle-b.gif

Edited by codeBoggs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this