title: How to convert geocoordinates in Javascript to geocoordinates in C#
body: <p>I have got some javascript code and I'd like to convert this to C#. I have no idea of the best way to structure this or if there is an easy way to convert the code.</p>
  
  <p>A sample of this code is shown below.</p>
  
  <pre><code>// ellipse parameters
  var e = { WGS84:    { a: 6378137,     b: 6356752.3142, f: 1/298.257223563 },
            Airy1830: { a: 6377563.396, b: 6356256.910,  f: 1/299.3249646   },
            Airy1849: { a: 6377340.189, b: 6356034.447,  f: 1/299.3249646   } };
  
  // helmert transform parameters
  var h = { WGS84toOSGB36: { tx: -446.448,  ty:  125.157,   tz: -542.060,   // m
                             rx:   -0.1502, ry:   -0.2470,  rz:   -0.8421,  // sec
                             s:    20.4894 },                               // ppm
            OSGB36toWGS84: { tx:  446.448,  ty: -125.157,   tz:  542.060,
                             rx:    0.1502, ry:    0.2470,  rz:    0.8421,
                             s:   -20.4894 } };
  
  
  function convertOSGB36toWGS84(p1) {
    var p2 = convert(p1, e.Airy1830, h.OSGB36toWGS84, e.WGS84);
    return p2;
  }
  </code></pre>
  
  <p>The full code can be downloaded from:
  <a href="http://www.thinkdotnet.co.uk/scripts/grid.js" rel="nofollow noreferrer">Javascript Grid Code</a></p>
  
  <p><strong>EDIT:</strong> Thank you all so far for your help; I guess the second requirement is that the reminder of the code in the link can be converted. The focus of the snippet was on the Anonymous Types.</p>