Converting Excel formula into LC

Want to move your code and projects to LiveCode but don't know where to start?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller

Post Reply
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Converting Excel formula into LC

Post by Simon » Fri Apr 19, 2013 4:11 am

Hello,
I'm trying to change this code:

Code: Select all

MOD(DEGREES(ACOS(((SIN(RADIANS(B3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS(B3))*SIN(RADIANS(AD2)))))+180,360)
Into an LC function.

When I thought I had it right the results wouldn't match up to Excels results. :x

Any help welcome.
Thank you,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Converting Excel formula into LC

Post by Simon » Fri Apr 19, 2013 9:12 pm

Just thought I'd bump this message.

Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Converting Excel formula into LC

Post by Simon » Sat Apr 20, 2013 5:29 am

Got It! :D

Code: Select all

Excel
MOD(DEGREES(ACOS(((SIN(RADIANS(B3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS(B3))*SIN(RADIANS(AD2)))))+180,360)
In LC becomes
((ACOS(((SIN((B3)*pi/180)*COS((AD2)*pi/180))-SIN((T2)*pi/180))/(COS((B3)*pi/180)*SIN((AD2)*pi/180))))*180/pi +180 MOD 360)
Too much over thinking, it really was almost a cut and paste.

Simon :D
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply

Return to “Converting to LiveCode”