Original Post
I've got another simple question that has to do with circles (the last question I had was answered quickly and in a way I could understand it, I was quiet impressed). After doing some research I found out how to find points on a circle if I know the center and the Radius, using x = r * cos( theta ) + j y = r * sin( theta ) + k with j,k being the center. I've also found out how to find a point in a circle that is closest to another given point. But what I can't find is how to tell what theta a point of a circle is on. Let me explain what I need to do. I have a ship that needs to move a given distance from its enemy (to keep out of weapon range), the circle represents all points on that given distance. Using the formula I can find the closest point (call it point A), 99% of the time that is all I'll need. But if that points fall outside the boundary of my map (x,y < 0 or x,y >= count(map)) I need to find the closest point from point A that is on my map. To do this I want to find the theta of point A, and iterate left and right from that point until I find the first point that is on the map and move the ship there. To make it clear I've never taken trig., I will someday, so if its a simple answer I don't know it, if its impossible to find them I am sorry for asking, but I can't find anything on Google, though I could be using the wrong phrase. Thanks for any future answers.