Code: Select all
put (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2 into a
put 2 * atan2( sqrt(a),sqrt(1-a)) into c
LCB
Code: Select all
put (sin(tChLat/2))^2 + cos(tLat1) * cos(tlat2) * (sin(tChLon/2))^2 into tFactorA
log "tFactorA is"
log tFactorA
put 2 * atan2(((tFactorA)^(0.5)),((1-tFactorA)^(0.5))) into tFactorC
log "tFactorC is"
log tFactorC
While I am new to LCB I am left wondering why I might want to use it for general functions instead of a LC library script as it is the type of language environment that I was pleased to leave behind when I discovered Livecode and seems clumsy in comparison e.g. debugging the second complex line of maths is proving to be time consuming and may only serve to highlight a limitation in the precision of the maths functions.
Any thoughts?
best wishes
Simon