Converting a formula to Rev

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
urbaud
Posts: 120
Joined: Tue Feb 24, 2009 12:10 am

Converting a formula to Rev

Post by urbaud »

Does anyone know how to write this formula in Rev code? The formula is part of other formulas to figure "Great Circle Distances". Formula: atn(x/sqr(-x * x +1))
I believe atn means arc tangent and sqr would be square root.
urbaud
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Converting a formula to Rev

Post by shaosean »

Code: Select all

atan2(x, sqrt(-x * x + 1))
urbaud
Posts: 120
Joined: Tue Feb 24, 2009 12:10 am

Re: Converting a formula to Rev

Post by urbaud »

Shao,
Thanks for your help with the formula. I'm trying to convert VBA code that calculates Great Circle distances. I'm having trouble with another formula, so I hope what you've suggested will work. Thanks again.
Dan
urbaud
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting a formula to Rev

Post by Klaus »

Hi all,

I was (and still am) very weak in maths :D, but the original function only has ONE value inside of the parenthesis so I think it should be:
atan(x/sqrt(-x * x +1))


Best from germany

Klaus
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Converting a formula to Rev

Post by shaosean »

Actually, if you read the description for atan2 you will see that it does the division of the two numbers and respects the signs..
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting a formula to Rev

Post by Klaus »

OK, as I wrote I have even no idea what atan or atan2 means, so sorry if I am wrong.
Sorry for the confusion :oops:
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Converting a formula to Rev

Post by shaosean »

I'll spank you later :P
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting a formula to Rev

Post by Klaus »

:D :D :D

P.S.
Looking for testers?
Here is one, just drop a line :)
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Converting a formula to Rev

Post by shaosean »

Apply through the support link (just create a new ticket)
Post Reply