Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

# A Formula To Convert Coords To Radians?

3 replies to this topic

### #1 Ryan 3000

Ryan 3000

• Members
• 834 posts
• OFFLINE
•
• Gender:Male
• Location:Maryland
• Local time:04:49 AM

Posted 05 June 2008 - 08:01 PM

Okay, so I have a programming assignment due tomorrow. It's pretty slick, I have a plane that flies around, you can shoot enemies that shoot back. The only source of navigation is an arrow that rotates about the plane, being given a number in radians to turn. So far, all of the algorithms I have used to convert the coordinates of the enemy into radians have failed. Below is a bad visual representation of what I need:

I have the Math class' Sin, Cos, Tan, Asin, Acos, Atan

Edited by Ryan 3000, 05 June 2008 - 08:02 PM.

No pessimist ever discovered the secrets of the stars, or sailed to an uncharted land.

### #2 groovicus

groovicus

• Security Colleague
• 9,963 posts
• OFFLINE
•
• Gender:Male
• Location:Centerville, SD
• Local time:02:49 AM

Posted 05 June 2008 - 08:41 PM

Just a stupid question; can the plane only shoot from the front, or can it shoot in whatever directions, no matter which way it is facing?

### #3 Ryan 3000

Ryan 3000
• Topic Starter

• Members
• 834 posts
• OFFLINE
•
• Gender:Male
• Location:Maryland
• Local time:04:49 AM

Posted 05 June 2008 - 09:19 PM

Sorry to trouble you, got the answer after fiddling around, adding my time to this being about 2 hours to figure this out... Thanks for the quick response.
No pessimist ever discovered the secrets of the stars, or sailed to an uncharted land.

### #4 Alan-LB

Alan-LB

• Members
• 71 posts
• OFFLINE
•
• Gender:Male
• Location:Junee, NSW, Australia
• Local time:07:49 PM

Posted 06 June 2008 - 01:49 AM

This may help in future - http://en.wikipedia.org/wiki/Polar_coordinates

Alan
There are 10 types of people - those who understand binary and those who don't!!

Today is the Beta version of Tomorrow!

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users