question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, thank you for your awesome math library!

I am thinking about taking advantage of this library and build a calculator for physicists and astronomers. Since cgs unit system is still widely used in the astronomy community, I’d like to help to add a cgs unit system to this library.

I found UNIT_SYSTEMS.cgs but didn’t find a .toCGS() function. Here’s what I plan to do:

  1. Complete UNIT_SYSTEMS.cgs: add a missing basic unit ‘Ba = g/(cm⋅s2)’; implement the ESU units system for Electromagnetics.
  2. Define Unit.prototype.toCGS: copy Unit.prototype.toSI and change every instance of UNIT_SYSTEMS.si to UNIT_SYSTEMS.cgs.

Please let me know what do you think, or what is already in math.js that I missed.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chongchonghecommented, Jul 29, 2020

Is there any other unit system other than SI, CGS, and US?

We can simply link .toSystem(‘SI’) to .toSI() and .toSystem(‘cgs’) to .toCGS(). The first step is to complete the CGS system. I’ll be working on that soon and make pull requests once finished.

0reactions
josdejongcommented, Jul 30, 2020

Some day when I finish UnitMath

Still looking forward to that day 😎 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Centimetre–gram–second system of units - Wikipedia
The centimetre–gram–second system of units (abbreviated CGS or cgs) is a variant of the metric system based on the centimetre as the unit...
Read more >
Cgs System - an overview | ScienceDirect Topics
The basic units of the cgs system are cm (centimeter), g (gram), and s (second). But, the fourth unit depends on whether it...
Read more >
CGS and SI (MKS) unit systems
CGS and SI (MKS) unit systems ; electric current, biot, Bi, ampere, A ; electric dipole moment, debye, D · coulomb metre, C...
Read more >
Definition of CGS system | PCMag
(Centimeter-Gram-Second system) A metric system of measurement that uses the centimeter, gram and second for length, mass and time. The units of force...
Read more >
cgs -- from Eric Weisstein's World of Physics
cgs is the system of units based on measuring lengths in centimeters, mass in grams, and time in seconds. It is a metric...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found