josdejong / josdejong/mathjs

cgs unit system

Open
#1,927 6 comments 0 reactions 0 assignees View on GitHub
feature help wanted
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.