UNPKG

thematic-earth

Version:

HTML-based, whole-Earth thematic maps using locally hosted data layers

2 lines 877 B
/* Copyright (c) 2023 Read Write Tools. Legal use subject to the Thematic Earth Software License Agreement. */ import*as ECEF from'../spherical-earth/coordinate-translations.js';const degreesToRadians=Math.PI/180;export default class GeocentricCoordinates{constructor(t,a,e){this.thematicEarthElement=t,this.earth=a,this.declination=e,this.delta0=e*degreesToRadians,this.allPointsNeedGeoCoords=!0,Object.seal(this)}reflectValues(){}setDeclination(t){this.declination=parseFloat(t),this.delta0=t*degreesToRadians,this.allPointsNeedGeoCoords=!0}getDeclination(){return this.declination}toPhiLambda(t){t.apparentPhi=t.phi,t.apparentLambda=t.lambda}toNightPhiLambda(t){var{x:a,y:e,z:i}=ECEF.ll2xyz(t.latitude,t.longitude),{x1:s,y1:o,z1:r}=ECEF.rotateX(a,e,i,this.delta0),{rho:n,theta:h,phi:d}=ECEF.xyz2rtp(s,o,r),l=ECEF.cophi2phi(d);t.apparentPhi=l,t.apparentLambda=h}inverse(t){}}