Interfacing with web services - advice needed

Mike Doub mikedoub at gmail.com
Tue Mar 17 19:04:18 EDT 2015


I'm on it.   :-).   There is one in there already, but David's adds a
Bering.,, but there's always room for more good routines.

David, if you have any others that you would like to share let me know.

Mike

On Tuesday, March 17, 2015, Richard Gaskin <ambassador at fourthworld.com>
wrote:

> David Epstein wrote:
>
>  Graham Samuel stipulated that he did not want to code a LiveCode
>> algorithm to solve this problem, but in case it might be useful here is a
>> function that I believe does so.
>>
>> function earthKM myLat,myLon,Lat0,Lon0, at aid
>>   -- return km distance on earth, load aid [angle in degrees] from origin
>> point Lon0,Lat0 to myPoint myLon,myLat
>>   put PI/180 into rpd -- radians per degree
>>   put myLat*rpd into myLat
>>   put myLon*rpd into myLon
>>   put Lat0*rpd into Lat0
>>   put Lon0*rpd into lon0
>>   put (SIN((myLat-Lat0)/2))^2+COS(Lat0)*COS(myLat)*(SIN((myLon-Lon0)/2))^2
>> into j
>>   put 6371*2*ASIN(MIN(1,j^0.5)) into dkm -- distance in km
>>   put ATAN2(SIN(myLon-Lon0)*COS(myLat),COS(Lat0)*SIN(myLat)-
>> SIN(Lat0)*COS(myLat)*COS(myLon-Lon0)) into k -- bearing in radians
>>   put k/rpd into aid -- in degrees
>>   return dkm
>> end earthKM
>>
>
> Rockin', David - thanks for posting that!
>
> @Michael Doub:  with Mr. Epstein's permission, I nominate this for
> inclusion in Master Library.
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  ____________________________________________________________________
>  Ambassador at FourthWorld.com                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list