From 9df1a7a128aad4e42e99cd33ead4fa4e268b31b1 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Mon, 4 May 2020 13:37:11 -0400 Subject: [PATCH] Added documentation for JavaScript function Constellation. --- generate/template/astronomy.js | 17 +++++++++++++++++ source/js/README.md | 21 +++++++++++++++++++++ source/js/astronomy.js | 17 +++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/generate/template/astronomy.js b/generate/template/astronomy.js index b4e5c8e3..4912a090 100644 --- a/generate/template/astronomy.js +++ b/generate/template/astronomy.js @@ -4180,6 +4180,23 @@ class ConstellationInfo { } +/** + * Determines the constellation that contains the given point in the sky. + * + * Given J2000 equatorial (EQJ) coordinates of a point in the sky, + * determines the constellation that contains that point. + * + * @param {number} ra + * The right ascension (RA) of a point in the sky, using the J2000 equatorial system. + * + * @param {number} dec + * The declination (DEC) of a point in the sky, using the J2000 equatorial system. + * + * @returns {Astronomy.ConstellationInfo} + * An object that contains the 3-letter abbreviation and full name + * of the constellation that contains the given (ra,dec), along with + * the converted B1875 (ra,dec) for that point. + */ Astronomy.Constellation = function(ra, dec) { if (dec < -90 || dec > +90) { throw 'Invalid declination angle. Must be -90..+90.'; diff --git a/source/js/README.md b/source/js/README.md index b5898a35..896f6f71 100644 --- a/source/js/README.md +++ b/source/js/README.md @@ -1711,6 +1711,27 @@ Target: ECL = ecliptic system, using equator at J2000 epoch. | observer | [Observer](#Astronomy.Observer) | The location of the horizontal observer. | +* * * + + + +### Astronomy.Constellation(ra, dec) ⇒ [ConstellationInfo](#Astronomy.ConstellationInfo) +Determines the constellation that contains the given point in the sky. + +Given J2000 equatorial (EQJ) coordinates of a point in the sky, +determines the constellation that contains that point. + +**Kind**: static method of [Astronomy](#Astronomy) +**Returns**: [ConstellationInfo](#Astronomy.ConstellationInfo) - An object that contains the 3-letter abbreviation and full name + of the constellation that contains the given (ra,dec), along with + the converted B1875 (ra,dec) for that point. + +| Param | Type | Description | +| --- | --- | --- | +| ra | number | The right ascension (RA) of a point in the sky, using the J2000 equatorial system. | +| dec | number | The declination (DEC) of a point in the sky, using the J2000 equatorial system. | + + * * * diff --git a/source/js/astronomy.js b/source/js/astronomy.js index 90ff94a9..c8ecb9f6 100644 --- a/source/js/astronomy.js +++ b/source/js/astronomy.js @@ -5701,6 +5701,23 @@ class ConstellationInfo { } +/** + * Determines the constellation that contains the given point in the sky. + * + * Given J2000 equatorial (EQJ) coordinates of a point in the sky, + * determines the constellation that contains that point. + * + * @param {number} ra + * The right ascension (RA) of a point in the sky, using the J2000 equatorial system. + * + * @param {number} dec + * The declination (DEC) of a point in the sky, using the J2000 equatorial system. + * + * @returns {Astronomy.ConstellationInfo} + * An object that contains the 3-letter abbreviation and full name + * of the constellation that contains the given (ra,dec), along with + * the converted B1875 (ra,dec) for that point. + */ Astronomy.Constellation = function(ra, dec) { if (dec < -90 || dec > +90) { throw 'Invalid declination angle. Must be -90..+90.';