Skip to content

Instantly share code, notes, and snippets.

@lsaavedr
Forked from marcelino-m/tcoord_mlp.py
Created April 13, 2017 18:35
Show Gist options
  • Select an option

  • Save lsaavedr/38c79573285c06c0ff77c4682055ab24 to your computer and use it in GitHub Desktop.

Select an option

Save lsaavedr/38c79573285c06c0ff77c4682055ab24 to your computer and use it in GitHub Desktop.

Revisions

  1. @marcelino-m marcelino-m revised this gist Apr 11, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions tcoord_mlp.py
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,10 @@ def mlp2sirgas(x_in, y_in):
    W = 0.0025759302920
    T_x = 299836.7973
    T_y = 6399665.955
    teta= W * m.py / 180.0
    teta= W * m.pi / 180.0

    x = K * ( x_in * cos(teta) + y_in * sin(teta) ) + T_x
    y = K * ( -x_in * sin(teta) + y_in * cos(teta) ) + T_y
    x = K * ( x_in * m.cos(teta) + y_in * m.sin(teta) ) + T_x
    y = K * ( -x_in * m.sin(teta) + y_in * m.cos(teta) ) + T_y

    return (x, y)

    @@ -20,9 +20,9 @@ def sirgas2mlp(x_in, x_in):
    W = -0.0025759302936
    T_x = -299733.0738
    T_y = -6403610.386
    teta= W * m.py / 180.0
    teta= W * m.pi / 180.0

    x = K * ( x_in * cos(teta) + y_in * sin(teta) ) + T_x
    y = K * ( -x_in * sin(teta) + y_in * cos(teta) ) + T_y
    x = K * ( x_in * m.cos(teta) + y_in * m.sin(teta) ) + T_x
    y = K * ( -x_in * m.sin(teta) + y_in * m.cos(teta) ) + T_y

    return (x, y)
  2. @marcelino-m marcelino-m created this gist Jan 20, 2017.
    28 changes: 28 additions & 0 deletions tcoord_mlp.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    import math as m


    def mlp2sirgas(x_in, y_in):
    K = 0.9993861340849
    W = 0.0025759302920
    T_x = 299836.7973
    T_y = 6399665.955
    teta= W * m.py / 180.0

    x = K * ( x_in * cos(teta) + y_in * sin(teta) ) + T_x
    y = K * ( -x_in * sin(teta) + y_in * cos(teta) ) + T_y

    return (x, y)


    def sirgas2mlp(x_in, x_in):

    K = 1.0006142429036
    W = -0.0025759302936
    T_x = -299733.0738
    T_y = -6403610.386
    teta= W * m.py / 180.0

    x = K * ( x_in * cos(teta) + y_in * sin(teta) ) + T_x
    y = K * ( -x_in * sin(teta) + y_in * cos(teta) ) + T_y

    return (x, y)