sqlite> select degrees( radians(175) + atan2( sin(radians(90)) *
sin(0.2/6378.14)*cos(radians(-42)), cos(0.2/6378.14) -
sin(radians(-42))*sin(radians(-42))));
264.997582396241

postgres=# select degrees( radians(175) + atan2( sin(radians(90)) *
sin(0.2/6378.14)*cos(radians(-42)), cos(0.2/6378.14) -
sin(radians(-42))*sin(radians(-42))));
     degrees
------------------
 175.002417603759

Are you sure the implementation of the functions degrees() and radians() are OK?

When I try this I get the correct result:

select 57.295779513082320876798154814105 * (175 * 0.01745329251994329576923690768489 +
 atan2(sin(90 * 0.01745329251994329576923690768489) *
sin(0.2 / 6378.14) * cos(-42 * 0.01745329251994329576923690768489), cos(0.2 / 6378.14) - sin(-42*0.01745329251994329576923690768489) * sin(-42 * 0.01745329251994329576923690768489)));

Output:

175,002417603759

That means that the trig functions in SQLIte are working fine, expectedly.

Excuse the large number of pointless decimals, I just copy-pasted the values from a calculator.

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to