Skip to content

Commit

Permalink
Merge 21a29de into ca79a0b
Browse files Browse the repository at this point in the history
  • Loading branch information
jhwohlgemuth committed Oct 26, 2018
2 parents ca79a0b + 21a29de commit e0e8fa1
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 94 deletions.
7 changes: 0 additions & 7 deletions Gruntfile.js
Expand Up @@ -24,13 +24,6 @@ module.exports = function (grunt) {
}
}
},
/**
* Open files in browsers for review
* @see {@link https://github.com/jsoverson/grunt-open}
**/
open: {
docs: { path: __dirname + '/docs/index.html' }
},
benchmark: {
options: { displayResults: true },
all: {
Expand Down
10 changes: 4 additions & 6 deletions docs/atmosphere.js.html
Expand Up @@ -98,9 +98,7 @@ <h1 class="page-title">atmosphere.js</h1>
* @returns {string} The name of the strata that contains the altitude
**/
function getStrata(altitude: number): string {
return findKey(ATMOSPHERIC_STRATA, (val) => {
return val[0] &lt;= altitude &amp;&amp; altitude &lt;= val[1];
});
return findKey(ATMOSPHERIC_STRATA, val => val[0] &lt;= altitude &amp;&amp; altitude &lt;= val[1]);
}
/**
* @description Get molecular weight based on layer
Expand Down Expand Up @@ -169,7 +167,7 @@ <h1 class="page-title">atmosphere.js</h1>
return h[i];
}
function getLayerIndex(altitude: number) {
let inLayer = partial(lte, altitude);
const inLayer = partial(lte, altitude);
return range(NUMBER_OF_LAYERS)
.map(h)
.findIndex(inLayer);
Expand Down Expand Up @@ -237,7 +235,7 @@ <h1 class="page-title">atmosphere.js</h1>
1.7,
1.1,
0
].map(function(a) {return a === 0 ? a : (a / 1000);});/* eslint-enable no-magic-numbers */
].map(a => a === 0 ? a : (a / 1000));/* eslint-enable no-magic-numbers */
return lapseRates[i];
}
/**
Expand Down Expand Up @@ -306,7 +304,7 @@ <h1 class="page-title">atmosphere.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
40 changes: 26 additions & 14 deletions docs/geodetic.js.html
Expand Up @@ -42,6 +42,19 @@ <h1 class="page-title">geodetic.js</h1>
<pre class="prettyprint source linenums"><code>// @flow
type point2 = [number, number];
type point3 = [number, number, number];
type DatumObject = {
EARTH_AUTHALIC_RADIUS: number,
EARTH_EQUATOR_RADIUS: number,
EARTH_MEAN_RADIUS: number,
FIRST_ECCENTRICITY_SQUARED: number,
FLATTENING: number,
LINEAR_ECCENTRICITY: number,
SEMI_MAJOR_AXIS: number,
SEMI_MINOR_AXIS: number
};
type FormatsObjects = {
CARTESIAN: string
};
/**
* @file Geodesic, cartographic, and geographic
* @author Jason Wohlgemuth
Expand All @@ -66,16 +79,16 @@ <h1 class="page-title">geodetic.js</h1>

function frac(float: number): any {
float = abs(float);
let digits = (float !== trunc(float)) ? String(float).split('.')[1].length : 0;
const digits = (float !== trunc(float)) ? String(float).split('.')[1].length : 0;
return (float - trunc(float)).toFixed(digits);
}
function clone(obj) {return JSON.parse(JSON.stringify(obj));}
function squared(n: number): number {return n * n;}
function getArguments() {return Array.prototype.slice.apply(arguments);}
function getArguments(...args) {return Array.prototype.slice.apply(args);}
function padArrayWithZeroes(n, arr) {return arr.concat(times(n - arr.length, constant(0)));}
function onlyAllowNumbers(arr) {return arr.every(isNumber) ? arr : [];}
function processInputs(fn) {
let processingSteps = [
const processingSteps = [
getArguments,
flatten,
curry(padArrayWithZeroes)(3),
Expand All @@ -92,7 +105,7 @@ <h1 class="page-title">geodetic.js</h1>
* @property {string} RADIAN_DEGREES=RadianDegrees
* @property {string} CARTESIAN=Cartesian
**/
const FORMATS = Object.create(null, {
const FORMATS: FormatsObjects = Object.create({}, {
CARTESIAN: {enumerable: true, value: 'Cartesian'},
DEGREES_MINUTES_SECONDS: {enumerable: true, value: 'DegreesMinuteSeconds'},
DEGREES_DECIMAL_MINUTES: {enumerable: true, value: 'DegreesDecimalMinutes'},
Expand All @@ -113,7 +126,7 @@ <h1 class="page-title">geodetic.js</h1>
* @property {number} AXIS_RATIO=0.996647189335 b/a
* @see [DoD World Geodetic System 1984]{@link http://earth-info.nga.mil/GandG/publications/tr8350.2/tr8350_2.html}
**/
const DATUM = Object.create(null, {
const DATUM: DatumObject = Object.create({}, {
EARTH_EQUATOR_RADIUS: {enumerable: true, value: 6378137},
EARTH_MEAN_RADIUS: {enumerable: true, value: 6371001},
EARTH_AUTHALIC_RADIUS: {enumerable: true, value: 6371007},
Expand Down Expand Up @@ -250,7 +263,7 @@ <h1 class="page-title">geodetic.js</h1>
const E_SQUARED = squared(E);
const R_SQUARED = squared(R);
const R_SQUARED_MINUS_E_SQUARED = R_SQUARED - E_SQUARED;
let u = sqrt(
const u = sqrt(
(1 / 2) * (R_SQUARED_MINUS_E_SQUARED + sqrt(squared(R_SQUARED_MINUS_E_SQUARED) + (4 * E_SQUARED * Z_SQUARED)))
);
const TAN_REDUCED_LATITUDE = (sqrt(squared(u) + E_SQUARED) * z) / (u * Q);
Expand Down Expand Up @@ -285,7 +298,7 @@ <h1 class="page-title">geodetic.js</h1>
return null;
}
const data = value;
const dimension = data.length - data.slice(0).reverse().findIndex(function(val) {return abs(val) > 0;});
const dimension = data.length - data.slice(0).reverse().findIndex(val => abs(val) > 0);
const degrees = trunc(value[0]);
let minutes = 0;
let seconds = 0;
Expand All @@ -297,8 +310,7 @@ <h1 class="page-title">geodetic.js</h1>
minutes = trunc(data[1]);
seconds = frac(data[1]) * SECONDS_PER_MINUTE;
} else if (dimension === GEOSPATIAL_VALUE_LENGTH) {
minutes = value[1];
seconds = value[2];
[, minutes, seconds] = value;
}
return [
degrees,
Expand Down Expand Up @@ -326,11 +338,11 @@ <h1 class="page-title">geodetic.js</h1>
if (value.length !== GEOSPATIAL_VALUE_LENGTH) {
return null;
}
let data = value;
let dimension = data.length - clone(data).reverse().findIndex((val) => {return abs(val) > 0;});
let degrees = trunc(data[0]);
const data = value;
const dimension = data.length - clone(data).reverse().findIndex(val => abs(val) > 0);
const degrees = trunc(data[0]);
let minutes = 0;
let seconds = 0;
const seconds = 0;
/* istanbul ignore else */
if (dimension === 1) {
minutes = frac(data[0]) * MINUTES_PER_DEGREE;
Expand Down Expand Up @@ -373,7 +385,7 @@ <h1 class="page-title">geodetic.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Expand Up @@ -110,7 +110,7 @@ <h2>License</h2><p><a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgi
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/math.js.html
Expand Up @@ -86,7 +86,7 @@ <h1 class="page-title">math.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-atmosphere-Atmospheric%20Strata.html
Expand Up @@ -134,7 +134,7 @@ <h2>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-atmosphere.html
Expand Up @@ -1362,7 +1362,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-geodetic-Geospatial%20Formats.html
Expand Up @@ -318,7 +318,7 @@ <h5 class="subsection-title">Properties:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-geodetic-WGS84%20Datum.html
Expand Up @@ -418,7 +418,7 @@ <h5 class="subsection-title">Properties:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-geodetic.html
Expand Up @@ -1574,7 +1574,7 @@ <h5>Examples</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-math.html
Expand Up @@ -167,7 +167,7 @@ <h1 class="page-title">math</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Oct 28 2017 21:27:59 GMT-0500 (CDT) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 26 2018 20:03:22 GMT+0300 (East Africa Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down

0 comments on commit e0e8fa1

Please sign in to comment.