I need to do a program for calculate distance between two lat/long points, but the formula uses math functions. Anybody know how can I do?
Thanks
http://www.peg.com/utilities.html
Sorry to say buth the math.i you refer are quite bad. Implementation is wrong (from a MATH point of view) for many of the functions: SIN, COS, ATAN and ASIN .
Just to confirm this try to run:
DEFINE VARIABLE i AS DECIMAL NO-UNDO.
DEFINE VARIABLE c AS CHARACTER NO-UNDO.
DEFINE VARIABLE si AS DECIMAL NO-UNDO.
DEFINE VARIABLE co AS DECIMAL NO-UNDO.
i = -180.
DO WHILE i
si = DYNAMIC-FUNCTION('sin':U, i).
co = DYNAMIC-FUNCTION('cos':U, i).
c = c + chr(10) + string(i) + ' ' +
STRING(co) + ' ' + STRING(si) + ' ' + STRING(si * si + co * co) .
i = i + 1.
END.
CLIPBOARD:VALUE = c.