.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Command 3.0- Save $12.00
War Plan Pacific- Save $7.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old September 22nd, 2004, 03:58 AM
Will's Avatar

Will Will is offline
Lieutenant Colonel
 
Join Date: Mar 2001
Location: Emeryville, CA
Posts: 1,412
Thanks: 0
Thanked 0 Times in 0 Posts
Will is on a distinguished road
Default Re: OT: Interesting math problem...

Narf, the equation means you take the constant e (2.71828183...) to the power of one half times the natural logarithm of x, or log base e of x. It doesn't have to be e though, you can get away with something like 10. So, 10^(0.5 * log(x)). It works because of the laws of logarithms, since a^b=c is equivalent to log(a)(c)=b. Then, it is simple to reconstruct as a^(log(a)(c))=c. Square root is simply a number to the one half power, so 10^(0.5 * log(x)) is the sqrt(x).

Either way, you're left with pretty much imprecise methods. I remember they briefly showed how to do it in high school, and that's probably an algorithm like the one Fyron pointed to, and it would be written in an equation as the Riemann sum of varying powers of 10, which would be a very nasty looking thing. Jack's method is easier to write, so I would go with that one. To write it in terms of an equation for square root, it would be something like:

lim(x->&#8734 R(x,N) = sqrt(N)

--edit: ^ that up there is supposed to be the infinity symbol.
__________________
GEEK CODE V.3.12: GCS/E d-- s: a-- C++ US+ P+ L++ E--- W+++ N+ !o? K- w-- !O M++ V? PS+ PE Y+ PGP t- 5++ X R !tv-- b+++ DI++ D+ G+ e+++ h !r*-- y?
SE4 CODE: A-- Se+++* GdY $?/++ Fr! C++* Css Sf Ai Au- M+ MpN S Ss- RV Pw- Fq-- Nd Rp+ G- Mm++ Bb@ Tcp- L+
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:43 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.