View Single Post
  #5   Spotlight this post!  
Unread 15-02-2004, 12:09
mtrawls's Avatar
mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Re: Square Root Function not working

Quote:
Originally Posted by Chris Hibner
Do you really need a sqare root? We originally had a square root in our waypoint calculation (to determine the distance from us to the waypoint), but we determined the square root was unessecary. Why? Because we're using feedback control to get to the position AND x^2 + y^2 becomes zero at the same point as sqrt(x^2 + y^2). Anyway, it's just a thought - you may not need the square root afterall.

-Chris
If you do find you need to compute sqrt(x^2+y^2), might I suggest the CORDIC algorithm (mentioned here before for sin/cos by Kevin Watson, I believe ... I found it very useful). Here is a very good file explaining it: http://www.andraka.com/files/crdcsrvy.pdf. The nice thing about it, is that it is a "shift and add" algorithm ... which is very fast. Maybe I'm just wierd, but I thought it was cool, and was disappointed when I realized we wouldn't be using it ... like Chris said he didn't need to compute the sqrt, we figured that we might not need to compute trig functions ourselves either.