How to use the proj4/lib/common/qsfnz.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
members.infinity_dist = 1000 * members.a
  } else if (p.projName === 'aea') {
    members = {
      lon0: p.long0,
      lat0: p.lat0,
      lat1: p.lat1,
      lat2: p.lat2,
      x0: defined(p.x0,0),
      y0: defined(p.y0,0),
      z0: defined(p.z0,0),
      k0: defined(p.k0,p.k,1),
      a: defined(p.a,e.a),
      sphere: p.sphere ? 1.0 : 0.0
    }
    members.e3 = Math.sqrt(1 - Math.pow(defined(p.b,e.b) / members.a, 2))
    var qs0 = qsfnz(members.e3, Math.sin(members.lat0))
    var qs1 = qsfnz(members.e3, Math.sin(members.lat1))
    var qs2 = qsfnz(members.e3, Math.sin(members.lat2))
    var ms1 = msfnz(members.e3, Math.sin(members.lat1),
      Math.cos(members.lat1))
    var ms2 = msfnz(members.e3, Math.sin(members.lat2),
      Math.cos(members.lat2))
    members.ns0 = Math.abs(members.lat1 - members.lat2) > 1.0e-10
      ? (ms1*ms1 - ms2*ms2) / (qs2 - qs1)
      : Math.sin(members.lat1),
    members.c = ms1*ms1 + members.ns0*qs1
    members.rh = e.a * Math.sqrt(members.c - members.ns0 * qs0) / members.ns0
  } else if (p.projName === 'geocent') {
    var a = defined(p.a,e.a), b = defined(p.b,e.b)
    members = {
      a: a,
      b: b,
github glslify / glsl-proj4 / index.js View on Github external
members = {
      lon0: p.long0,
      lat0: p.lat0,
      lat1: p.lat1,
      lat2: p.lat2,
      x0: defined(p.x0,0),
      y0: defined(p.y0,0),
      z0: defined(p.z0,0),
      k0: defined(p.k0,p.k,1),
      a: defined(p.a,e.a),
      sphere: p.sphere ? 1.0 : 0.0
    }
    members.e3 = Math.sqrt(1 - Math.pow(defined(p.b,e.b) / members.a, 2))
    var qs0 = qsfnz(members.e3, Math.sin(members.lat0))
    var qs1 = qsfnz(members.e3, Math.sin(members.lat1))
    var qs2 = qsfnz(members.e3, Math.sin(members.lat2))
    var ms1 = msfnz(members.e3, Math.sin(members.lat1),
      Math.cos(members.lat1))
    var ms2 = msfnz(members.e3, Math.sin(members.lat2),
      Math.cos(members.lat2))
    members.ns0 = Math.abs(members.lat1 - members.lat2) > 1.0e-10
      ? (ms1*ms1 - ms2*ms2) / (qs2 - qs1)
      : Math.sin(members.lat1),
    members.c = ms1*ms1 + members.ns0*qs1
    members.rh = e.a * Math.sqrt(members.c - members.ns0 * qs0) / members.ns0
  } else if (p.projName === 'geocent') {
    var a = defined(p.a,e.a), b = defined(p.b,e.b)
    members = {
      a: a,
      b: b,
      e: Math.sqrt((a*a-b*b)/(a*a)),
      eprime: Math.sqrt((a*a-b*b)/(b*b)),
github glslify / glsl-proj4 / index.js View on Github external
} else if (p.projName === 'aea') {
    members = {
      lon0: p.long0,
      lat0: p.lat0,
      lat1: p.lat1,
      lat2: p.lat2,
      x0: defined(p.x0,0),
      y0: defined(p.y0,0),
      z0: defined(p.z0,0),
      k0: defined(p.k0,p.k,1),
      a: defined(p.a,e.a),
      sphere: p.sphere ? 1.0 : 0.0
    }
    members.e3 = Math.sqrt(1 - Math.pow(defined(p.b,e.b) / members.a, 2))
    var qs0 = qsfnz(members.e3, Math.sin(members.lat0))
    var qs1 = qsfnz(members.e3, Math.sin(members.lat1))
    var qs2 = qsfnz(members.e3, Math.sin(members.lat2))
    var ms1 = msfnz(members.e3, Math.sin(members.lat1),
      Math.cos(members.lat1))
    var ms2 = msfnz(members.e3, Math.sin(members.lat2),
      Math.cos(members.lat2))
    members.ns0 = Math.abs(members.lat1 - members.lat2) > 1.0e-10
      ? (ms1*ms1 - ms2*ms2) / (qs2 - qs1)
      : Math.sin(members.lat1),
    members.c = ms1*ms1 + members.ns0*qs1
    members.rh = e.a * Math.sqrt(members.c - members.ns0 * qs0) / members.ns0
  } else if (p.projName === 'geocent') {
    var a = defined(p.a,e.a), b = defined(p.b,e.b)
    members = {
      a: a,
      b: b,
      e: Math.sqrt((a*a-b*b)/(a*a)),

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