Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
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.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

A Formula To Convert Coords To Radians?


  • Please log in to reply
3 replies to this topic

#1 Ryan 3000

Ryan 3000

  • Members
  • 834 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Maryland
  • Local time:08:08 PM

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:



Posted Image
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.

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:06:08 PM

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:08:08 PM

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:11:08 AM

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