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 » Tue Nov 23, 2010 2:17 am

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 » Tue Nov 23, 2010 2:43 am

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 » Tue Nov 23, 2010 6:01 am

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: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting a formula to Rev

Post by Klaus » Tue Nov 23, 2010 1:37 pm

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 » Tue Nov 23, 2010 2:14 pm

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: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting a formula to Rev

Post by Klaus » Tue Nov 23, 2010 2:21 pm

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 » Tue Nov 23, 2010 2:31 pm

I'll spank you later :P

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting a formula to Rev

Post by Klaus » Tue Nov 23, 2010 2:32 pm

: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 » Tue Nov 23, 2010 2:40 pm

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

Post Reply