Class: Wgs2Tky

Inherits:
Object
  • Object
show all
Extended by:
Math
Includes:
Math
Defined in:
lib/wgs2tky.rb

Overview

wgs2tky.rb

-- GPS data converter

kp<[email protected]> Destributed under the GPL

Constant Summary collapse

Pi =
Math::PI
Rd =
Pi/180
A =

WGS84

6378137.0
F =

赤道半径

1/298.257223563
E2 =

扁平率

F*2 - F*F
A_ =

Tokyo

6378137.0 - 739.845
F_ =

6377397.155

1/298.257223563 - 0.000010037483
E2_ =

1 / 299.152813

F_*2 - F_*F_
Dx =
+128
Dy =
-481
Dz =
-664

Class Method Summary collapse

Class Method Details

.conv!(lat, lon, h = 0) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/wgs2tky.rb', line 28

def Wgs2Tky.conv!(lat,lon,h = 0)
  b = lat[0].to_f + lat[1].to_f/60 + lat[2].to_f/3600
  l = lon[0].to_f + lon[1].to_f/60 + lon[2].to_f/3600

  (x,y,z) = Wgs2Tky._llh2xyz(b,l,h,A,E2)

  x+=Dx
  y+=Dy
  z+=Dz

  (b,l,h) = Wgs2Tky._xyz2llh(x,y,z,A_,E2_)

  lat[0..2]=Wgs2Tky._deg2gdms(b)
  lon[0..2]=Wgs2Tky._deg2gdms(l)
end