• Stars
    star
    140
  • Rank 261,473 (Top 6 %)
  • Language
    JavaScript
  • License
    ISC License
  • Created about 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Equations for computing the position of the Sun.

Equations based on NOAA’s Solar Calculator.

Examples:

API Reference

# solar.apparentLongitude(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s apparent longitude in degrees.

# solar.century(date) <>

Given a date, returns the fraction number of centures since the J2000.0 epoch, 2000-01-01T12:00:00Z. (No correction is made between Terrestrial Time and UTC.)

# solar.declination(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s declination in degrees.

# solar.equationOfCenter(t) <>

Given a time t in J2000.0 centuries, returns the Sun and Earth’s equation of the center in degrees.

# solar.equationOfTime(t) <>

Given a time t in J2000.0 centuries, returns the Sun and Earth’s equation of time in minutes.

# solar.hours(date, latitude) <>

Given a date and a latitude in degrees, returns the number of daylight hours.

# solar.meanAnomaly(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s mean anomaly in degrees.

# solar.meanLongitude(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s mean longitude in degrees.

# solar.noon(date, longitude) <>

Given a date and a longitude in degrees, returns the time of the solar noon. (TODO This description isn’t quite right, because the date is first floored to the UTC day boundary and then adjusted based on the specified longitude.)

# solar.obliquityOfEcliptic(t) <>

Given a time t in J2000.0 centuries, returns the obliquity of the ecliptic in degrees.

# solar.orbitEccentricity(t) <>

Given a time t in J2000.0 centuries, returns Earth’s orbital eccentricity.

# solar.riseHourAngle(date, latitude) <>

Given a date and a latitude in degrees, returns the hour angle of sunrise on the given day in degrees.

# solar.rise(date, latitude, longitude) <>

Given a date and a latitude and longitude in degrees, returns the time of sunrise. (TODO Describe more precisely the date of the returned sunrise.)

# solar.set(date, latitude, longitude) <>

Given a date and a latitude and longitude in degrees, returns the time of sunset. (TODO Describe more precisely the date of the returned sunset.)

# solar.trueLongitude(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s true longitude in degrees.

More Repositories

1

stack

A presentation library with intuitive, scroll-based navigation.
JavaScript
1,155
star
2

shapefile

A cross-platform streaming parser for the ESRI Shapefile spatial data format.
JavaScript
754
star
3

protovis

A visualization toolkit for JavaScript using SVG.
JavaScript
625
star
4

gistup

Create a gist from terminal, then use git to update it.
JavaScript
490
star
5

ndjson-cli

Command line tools for operating on newline-delimited JSON streams.
JavaScript
272
star
6

smash

SMASH TOGETHER MULTIPLE FILES [deprecated; try rollup/rollup]
JavaScript
199
star
7

us-rivers

A map of flowlines from NHDPlus.
JavaScript
123
star
8

rw

Now stdin and stdout are files.
JavaScript
117
star
9

git-static

A versioned static file server backed by Git.
JavaScript
116
star
10

bl.ocks.org

Browser Extensions for bl.ocks.org
JavaScript
92
star
11

svjimmy

A bookmarklet to download SVG as PNG.
HTML
74
star
12

polly-b-gone

A physics platform game about a plucky wheeled robot named Polly.
C++
61
star
13

pixymaps

Experimental canvas-based mapping library.
JavaScript
57
star
14

json-write

A stream-based serializer for JSON.
JavaScript
36
star
15

internmap

Map and Set with automatic key interning
JavaScript
32
star
16

dependency-tree

Hierarchical edge bundling in JavaScript & Canvas.
JavaScript
31
star
17

topoedit

A visual editor for TopoJSON.
28
star
18

isoformat

Formats dates as the shortest equivalent ISO 8601 UTC string
JavaScript
25
star
19

node-mappy

Server-side map rendering for Node.
JavaScript
24
star
20

file-source

Read files as standard WhatWG streams in Node.
JavaScript
22
star
21

epheme

The precursor to D3.
JavaScript
21
star
22

path-data

An SVG path parser and normalizer.
JavaScript
19
star
23

mbostock.github.com

Redirect to http://bost.ocks.org/mike/.
19
star
24

json2module

Convert a JSON object to an ES6 module.
JavaScript
18
star
25

cube-logplex

Route Heroku logs to Cube for analysis and visualization.
JavaScript
17
star
26

tape-await

Yet another async-await helper for tape.
JavaScript
17
star
27

colorbrewer-theme

ColorBrewer-based themes for Sublime Text.
16
star
28

mongo-mock

DEPRECATED
JavaScript
16
star
29

topotree

Spatial indexing for topological operations.
JavaScript
15
star
30

preamble

Generate a tiny preamble from a package.json.
JavaScript
14
star
31

rollup-plugin-ascii

Rewrite JavaScript to escape any non-ASCII characters in string literals.
JavaScript
12
star
32

dedom

A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.
JavaScript
12
star
33

stream-source

Read Node streams as standard WhatWG streams.
JavaScript
12
star
34

twitch-chat-relay

A relay to allow listening to Twitch chat.
JavaScript
11
star
35

slice-source

Read the specified number of bytes from a standard WhatWG stream.
JavaScript
10
star
36

nns

DEPRECATED; Use D3.
JavaScript
9
star
37

cstree

Comma-separated tree
JavaScript
8
star
38

hide-google-plus-notification

Extensions for hiding the annoying red Google+ notification.
CSS
7
star
39

randomized-flood-fill

Flood fill with color randomization.
JavaScript
7
star
40

por

A streaming parser for the Portable File Format (.por) used by PSPP & SPSS.
JavaScript
7
star
41

array-source

Read arrays as standard WhatWG streams.
JavaScript
6
star
42

justascii

Rewrite JavaScript to escape any non-ASCII characters in string literals.
JavaScript
6
star
43

path-source

Read files in Node, or fetch URLs in browser, as standard WhatWG streams.
JavaScript
5
star
44

rw-vs-fs

Comparing rw with Node’s built-in fs & stream.
JavaScript
5
star
45

relative-time-format-locale

An AMD-friendly distribution of relative-time-format and its locales.
JavaScript
4
star
46

hide-flickr-eyebrow

Hide that ghastly eyebrow.
JavaScript
3
star
47

ocks.org

http://ocks.org
3
star
48

rollup-1655

A test case for rollup/rollup#1655.
JavaScript
2
star
49

crom-test-foo

A simple test for Crom dependencies.
JavaScript
2
star
50

rollup-leaflet-example

Using Rollup to bundle Leaflet and plugins as an ES module.
JavaScript
2
star
51

crom-test-bar

Another test for Crom dependencies.
2
star
52

framework-help

Examples and answers to support questions for Observable Framework
JavaScript
2
star
53

node-envy

DEPRECATED; Use env-js, jsdom, etc.
JavaScript
1
star