@livinglogic/livingapi 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livinglogic/livingapi",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Javascript version of the LivingAPI classes of LivingApps",
5
5
  "repository": {
6
6
  "type": "git",
package/src/livingapi.js CHANGED
@@ -276,6 +276,9 @@ export class Globals extends Base
276
276
  const C = sqcos(G) * sqcos(l) + sqsin(F) * sqsin(l);
277
277
  const w = Math.atan(Math.sqrt(S/C));
278
278
  const D = 2 * w * radius;
279
+ if (D === 0.0)
280
+ /* The "correction" calculation below would fail if the raw distance is 0 */
281
+ return D;
279
282
  const T = Math.sqrt(S*C)/w;
280
283
  const H1 = (3*T-1)/(2*C);
281
284
  const H2 = (3*T+1)/(2*S);