Set scale to be 5 for bc lat/lon converisons

master
Miles Alan 5 years ago
parent 00e09e6897
commit 6cbd8670c5
  1. 4
      scripts/core/sxmo_gpsutil.sh

@ -11,6 +11,7 @@ CPI=3.14159265358979323846
lat2px() {
DEGREES="$1"; ZOOM="$2"
echo "
scale=5;
define atanh(x) { return((l(1 + x) - l(1 - x))/2) };
-( \
atanh(s(($DEGREES * $CPI / 180))) * \
@ -21,6 +22,7 @@ lat2px() {
lon2px() {
DEGREES="$1"; ZOOM="$2"
echo "
scale=5;
( \
($DEGREES * $CPI / 180) * $CTILESIZE * \
e($ZOOM * $CLN2) / (2 * $CPI) \
@ -30,6 +32,7 @@ lon2px() {
px2lat() {
PX="$1"; ZOOM="$2"
echo "
scale=5;
define asin(x) {
if(x==1) return($CPI/2); if(x==-1) return(-$CPI/2); return(a(x/sqrt(1-(x^2))));
}
@ -43,6 +46,7 @@ px2lat() {
px2lon() {
PX="$1"; ZOOM="$2"
echo "
scale=5;
( \
($PX - (e($ZOOM * $CLN2) * ($CTILESIZE / 2))) * 2 * $CPI / \
($CTILESIZE * e($ZOOM * $CLN2)) \

Loading…
Cancel
Save