How to use the proj4/lib/common/tsfnz.js function in proj4

To help you get started, we’ve selected a few proj4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glslify / glsl-proj4 / index.js View on Github external
e0: e0fn(es),
      e1: e1fn(es),
      e2: e2fn(es),
      e3: e3fn(es),
      es: (a*a-b*b)/(a*a),
      ep2: (a*a-b*b)/(b*b)
    }
    members.ml0 = a * mlfn(members.e0,members.e1,
      members.e2,members.e3,members.lat0)
  } else if (p.projName === 'lcc') {
    var a = defined(p.a,e.a), b = defined(p.b,e.b)
    var e = Math.sqrt(1-(b/a)*(b/a))
    var ms1 = msfnz(e, Math.sin(p.lat1), Math.cos(p.lat1))
    var ms2 = msfnz(e, Math.sin(p.lat2), Math.cos(p.lat2))
    var ts0 = tsfnz(e, p.lat0, Math.sin(p.lat0))
    var ts1 = tsfnz(e, p.lat1, Math.sin(p.lat1))
    var ts2 = tsfnz(e, p.lat2, Math.sin(p.lat2))
    var ns = Math.abs(p.lat1 - p.lat2) > 1e-10
      ? Math.log(ms1/ms2)/Math.log(ts1/ts2)
      : Math.sin(p.lat1)
    if (isNaN(ns)) ns = Math.sin(p.lat1)
    var f0 = ms1 / (ns * Math.pow(ts1, ns))
    members = {
      lon0: p.long0,
      lat0: p.lat0,
      lat1: p.lat1,
      lat2: defined(p.lat2, p.lat1),
      x0: defined(p.x0, 0),
      y0: defined(p.y0, 0),
      z0: defined(p.z0,0),
      k0: defined(p.k0,p.k,1),
      a: a,
github glslify / glsl-proj4 / index.js View on Github external
sphere: p.sphere ? 1.0 : 0.0,
      e0: e0fn(es),
      e1: e1fn(es),
      e2: e2fn(es),
      e3: e3fn(es),
      es: (a*a-b*b)/(a*a),
      ep2: (a*a-b*b)/(b*b)
    }
    members.ml0 = a * mlfn(members.e0,members.e1,
      members.e2,members.e3,members.lat0)
  } else if (p.projName === 'lcc') {
    var a = defined(p.a,e.a), b = defined(p.b,e.b)
    var e = Math.sqrt(1-(b/a)*(b/a))
    var ms1 = msfnz(e, Math.sin(p.lat1), Math.cos(p.lat1))
    var ms2 = msfnz(e, Math.sin(p.lat2), Math.cos(p.lat2))
    var ts0 = tsfnz(e, p.lat0, Math.sin(p.lat0))
    var ts1 = tsfnz(e, p.lat1, Math.sin(p.lat1))
    var ts2 = tsfnz(e, p.lat2, Math.sin(p.lat2))
    var ns = Math.abs(p.lat1 - p.lat2) > 1e-10
      ? Math.log(ms1/ms2)/Math.log(ts1/ts2)
      : Math.sin(p.lat1)
    if (isNaN(ns)) ns = Math.sin(p.lat1)
    var f0 = ms1 / (ns * Math.pow(ts1, ns))
    members = {
      lon0: p.long0,
      lat0: p.lat0,
      lat1: p.lat1,
      lat2: defined(p.lat2, p.lat1),
      x0: defined(p.x0, 0),
      y0: defined(p.y0, 0),
      z0: defined(p.z0,0),
      k0: defined(p.k0,p.k,1),
github glslify / glsl-proj4 / index.js View on Github external
e1: e1fn(es),
      e2: e2fn(es),
      e3: e3fn(es),
      es: (a*a-b*b)/(a*a),
      ep2: (a*a-b*b)/(b*b)
    }
    members.ml0 = a * mlfn(members.e0,members.e1,
      members.e2,members.e3,members.lat0)
  } else if (p.projName === 'lcc') {
    var a = defined(p.a,e.a), b = defined(p.b,e.b)
    var e = Math.sqrt(1-(b/a)*(b/a))
    var ms1 = msfnz(e, Math.sin(p.lat1), Math.cos(p.lat1))
    var ms2 = msfnz(e, Math.sin(p.lat2), Math.cos(p.lat2))
    var ts0 = tsfnz(e, p.lat0, Math.sin(p.lat0))
    var ts1 = tsfnz(e, p.lat1, Math.sin(p.lat1))
    var ts2 = tsfnz(e, p.lat2, Math.sin(p.lat2))
    var ns = Math.abs(p.lat1 - p.lat2) > 1e-10
      ? Math.log(ms1/ms2)/Math.log(ts1/ts2)
      : Math.sin(p.lat1)
    if (isNaN(ns)) ns = Math.sin(p.lat1)
    var f0 = ms1 / (ns * Math.pow(ts1, ns))
    members = {
      lon0: p.long0,
      lat0: p.lat0,
      lat1: p.lat1,
      lat2: defined(p.lat2, p.lat1),
      x0: defined(p.x0, 0),
      y0: defined(p.y0, 0),
      z0: defined(p.z0,0),
      k0: defined(p.k0,p.k,1),
      a: a,
      b: b,

proj4

Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.

MIT
Latest version published 29 days ago

Package Health Score

89 / 100
Full package analysis

Similar packages