New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@math.gl/sun

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@math.gl/sun - npm Package Compare versions

Comparing version 3.6.0-alpha.1 to 3.6.0-alpha.2

4

dist/es5/index.js

@@ -8,3 +8,3 @@ "use strict";

enumerable: true,
get: function () {
get: function get() {
return _suncalc.getSunPosition;

@@ -15,3 +15,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _suncalc.getSunDirection;

@@ -18,0 +18,0 @@ }

@@ -8,18 +8,18 @@ "use strict";

exports.getSunDirection = getSunDirection;
const DEGREES_TO_RADIANS = Math.PI / 180;
const DAY_IN_MS = 1000 * 60 * 60 * 24;
const JD1970 = 2440588;
const JD2000 = 2451545;
const e = DEGREES_TO_RADIANS * 23.4397;
const M0 = 357.5291;
const M1 = 0.98560028;
const THETA0 = 280.147;
const THETA1 = 360.9856235;
var DEGREES_TO_RADIANS = Math.PI / 180;
var DAY_IN_MS = 1000 * 60 * 60 * 24;
var JD1970 = 2440588;
var JD2000 = 2451545;
var e = DEGREES_TO_RADIANS * 23.4397;
var M0 = 357.5291;
var M1 = 0.98560028;
var THETA0 = 280.147;
var THETA1 = 360.9856235;
function getSunPosition(timestamp, latitude, longitude) {
const longitudeWestInRadians = DEGREES_TO_RADIANS * -longitude;
const phi = DEGREES_TO_RADIANS * latitude;
const d = toDays(timestamp);
const c = getSunCoords(d);
const H = getSiderealTime(d, longitudeWestInRadians) - c.rightAscension;
var longitudeWestInRadians = DEGREES_TO_RADIANS * -longitude;
var phi = DEGREES_TO_RADIANS * latitude;
var d = toDays(timestamp);
var c = getSunCoords(d);
var H = getSiderealTime(d, longitudeWestInRadians) - c.rightAscension;
return {

@@ -32,7 +32,7 @@ azimuth: getAzimuth(H, phi, c.declination),

function getSunDirection(timestamp, latitude, longitude) {
const {
azimuth,
altitude
} = getSunPosition(timestamp, latitude, longitude);
const azimuthN = azimuth + Math.PI;
var _getSunPosition = getSunPosition(timestamp, latitude, longitude),
azimuth = _getSunPosition.azimuth,
altitude = _getSunPosition.altitude;
var azimuthN = azimuth + Math.PI;
return [-Math.sin(azimuthN), Math.cos(azimuthN), -Math.sin(altitude)];

@@ -50,3 +50,3 @@ }

function getRightAscension(eclipticLongitude, b) {
const lambda = eclipticLongitude;
var lambda = eclipticLongitude;
return Math.atan2(Math.sin(lambda) * Math.cos(e) - Math.tan(b) * Math.sin(e), Math.cos(lambda));

@@ -56,3 +56,3 @@ }

function getDeclination(eclipticLongitude, b) {
const lambda = eclipticLongitude;
var lambda = eclipticLongitude;
return Math.asin(Math.sin(b) * Math.cos(e) + Math.cos(b) * Math.sin(e) * Math.sin(lambda));

@@ -62,5 +62,5 @@ }

function getAzimuth(hourAngle, latitudeInRadians, declination) {
const H = hourAngle;
const phi = latitudeInRadians;
const delta = declination;
var H = hourAngle;
var phi = latitudeInRadians;
var delta = declination;
return Math.atan2(Math.sin(H), Math.cos(H) * Math.sin(phi) - Math.tan(delta) * Math.cos(phi));

@@ -70,5 +70,5 @@ }

function getAltitude(hourAngle, latitudeInRadians, declination) {
const H = hourAngle;
const phi = latitudeInRadians;
const delta = declination;
var H = hourAngle;
var phi = latitudeInRadians;
var delta = declination;
return Math.asin(Math.sin(phi) * Math.sin(delta) + Math.cos(phi) * Math.cos(delta) * Math.cos(H));

@@ -86,5 +86,5 @@ }

function getEclipticLongitude(meanAnomaly) {
const M = meanAnomaly;
const C = DEGREES_TO_RADIANS * (1.9148 * Math.sin(M) + 0.02 * Math.sin(2 * M) + 0.0003 * Math.sin(3 * M));
const P = DEGREES_TO_RADIANS * 102.9372;
var M = meanAnomaly;
var C = DEGREES_TO_RADIANS * (1.9148 * Math.sin(M) + 0.02 * Math.sin(2 * M) + 0.0003 * Math.sin(3 * M));
var P = DEGREES_TO_RADIANS * 102.9372;
return M + C + P + Math.PI;

@@ -94,4 +94,4 @@ }

function getSunCoords(dates) {
const M = getSolarMeanAnomaly(dates);
const L = getEclipticLongitude(M);
var M = getSolarMeanAnomaly(dates);
var L = getEclipticLongitude(M);
return {

@@ -98,0 +98,0 @@ declination: getDeclination(L, 0),

@@ -8,3 +8,3 @@ {

},
"version": "3.6.0-alpha.1",
"version": "3.6.0-alpha.2",
"keywords": [

@@ -32,3 +32,3 @@ "javascript",

},
"gitHead": "45386981340895bf201c2ebb76257c9bbffd8ff6"
"gitHead": "ea7dc265c98b68af56218302d1d42b7d65f74ccb"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc