Apply current workspace changes

This commit is contained in:
2026-04-22 01:52:21 +08:00
parent cf34b9a8ed
commit cb518b431f
449 changed files with 92252 additions and 321 deletions
+67
View File
@@ -0,0 +1,67 @@
#!/bin/csh -f
#
#convet utm coord. to lon and lat
#
if ( $#argv < 5) then
more <<EOF
utm2ll is a C-shell script which convets utm coord. to lon and lat
Usage: utm2ll zone x0 y0 dx dy
Where zone is the conventional zone number=int(lon/6)+31
x0,y0 is the origin of UTM projection at easting and northing(meter)
dx,dy is the offset from origin at meter unit
Example: utm2ll 45 311072.36 3542183.56 27000 62000
origin 85 32(lon,lat)
Qiao Xuejun 2008/2/20
EOF
exit
endif
set zone = $argv[1]
set x0 = $argv[2]
set y0 = $argv[3]
set dx = $argv[4]
set dy = $argv[5]
set pi = 3.141592653589793
set a = 6378137.00
set b = 6356752.3142
#echo $a $b
set k0 = 0.9996
set x = `echo $x0 $dx |awk '{print 500000-($1+$2)}'`
set y = `echo $y0 $dy |awk '{print $1+$2}'`
set e = `echo $a $b |awk '{print sqrt(1-($2*$2)/($1*$1))}'`
set ep2 = `echo $e $a $b |awk '{print ($1*$2/$3)*($1*$2/$3)}'`
set sin1 = `echo $pi |awk '{print $1/(180*60*60)}'`
set m = `echo $y $k0|awk '{print $1/$2}'`
set mu = `echo $m $a $e|awk '{print $1/($2*(1-$3*$3/4-3*$3*$3*$3*$3/64-5*$3*$3*$3*$3*$3*$3/256))}'`
set e1 = `echo $e |awk '{print (1-sqrt(1-$1*$1))/ (1+sqrt(1-$1*$1))}'`
set j1 = `echo $e1 |awk '{print 3*$1/2-27*$1*$1*$1/32}'`
set j2 = `echo $e1 |awk '{print 21*$1*$1/16-55*$1*$1*$1*$1/32}'`
set j3 = `echo $e1 |awk '{print 151*$1*$1*$1/96}'`
set j4 = `echo $e1 |awk '{print 1097*$1*$1*$1*$1/512}'`
set fp = `echo $mu $j1 $j2 $j3 $j4|awk '{print $1+$2*sin(2*$1)+$3*sin(4*$1)+$4*sin(6*$1)+$5*sin(8*$1)}'`
set c1 = `echo $ep2 $fp|awk '{print $1*cos($2)*cos($2)}'`
set t1 = `echo $fp |awk '{print sin($1)*sin($1)/(cos($1)*cos($1))}'`
set r1 = `echo $a $e $fp |awk '{print $1*(1-$2*$2)/((1-$2*$2*sin($3)*sin($3))*sqrt(1-$2*$2*sin($3)*sin($3)))}'`
set n1 = `echo $a $e $fp |awk '{print $1/sqrt(1-$2*$2*sin($3)*sin($3))}'`
set d = `echo $x $n1 $k0 |awk '{print $1/($2*$3)}'`
set q1 = `echo $n1 $fp $r1|awk '{print $1*(sin($2)/cos($2))/$3}'`
set q2 = `echo $d |awk '{print $1*$1/2}'`
set q3 = `echo $t1 $c1 $ep2 $d |awk '{print (5+3*$1+10*$2-4*$2*$2-9*$3)*$4*$4*$4*$4/24 }'`
set q4 = `echo $t1 $c1 $ep2 $d |awk '{print (61+90*$1+298*$2+45*$1*$1-3*$2*$2-252*$3)*$4*$4*$4*$4*$4*$4/720 }'`
set q5 = $d
set q6 = `echo $t1 $c1 $d |awk '{print (1+2*$1+$2)*$3*$3*$3/6}'`
set q7 = `echo $c1 $t1 $ep2 $d |awk '{print (5-2*$1+28*$2-3*$1*$1+8*$3+24*$2*$2)*$4*$4*$4*$4*$4/120}'`
#echo $x $e $ep2 $sin1 $m $mu $e1 $j1 $j2 $j3 $j4 $fp $c1 $t1 $r1 $n1 $d $q1 $q2 $q3 $q4 $q5 $q6 $q7
set dlong = `echo $q5 $q6 $q7 $fp|awk '{print ($1-$2+$3)/cos($4)}'`
set lat = `echo $fp $q1 $q2 $q3 $q4 |awk '{print $1-$2*($3-$4+$5)}'`
set lon0 = `echo $zone |awk '{print 6*$1-183}'`
set lon = `echo $lon0 $dlong $pi |awk '{print $1-$2*180/$3 }'`
set lat = `echo $lat $pi |awk '{print $1*180/$2 }'`
echo $lon $lat