Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(/convert): complex types #201

Open
kyranet opened this issue Feb 8, 2024 · 0 comments
Open

feat(/convert): complex types #201

kyranet opened this issue Feb 8, 2024 · 0 comments

Comments

@kyranet
Copy link
Member

kyranet commented Feb 8, 2024

Sadly, in #195, speed conversions were removed. This is because speed is an equation using 2 units: Length / Time.

What complex types aim to do is support more complex types with matching (m³/mincm³/s, but m³/J doesn't ↦ cm³/s) and sorting (h*cm³cm³*h).

The syntax would be the standard one, using and * for multiplications, ÷ and / for divisions. Parentheses would be used to support more complex units.

Lastly, some of the units from the list would also need to define complex types, for example, 1 knot is 0.51444444 m/s, and 1 mach is 343 m/s.

Tip

To convert an unit from a complex unit to another, you may need to convert the unit to SI for each unit. For example, 1 km/h would become 1000 m/h and then 0.27777778 m/s, then the opposite is done for the target unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant