Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ovpavlov/unit-generator
https://github.com/ovpavlov/unit-generator
dimensional-analysis math mathematics metric-system physics units units-of-measurement unity unity3d
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ovpavlov/unit-generator
- Owner: OVPavlov
- License: mit
- Created: 2024-10-11T16:00:02.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T09:32:43.000Z (3 months ago)
- Last Synced: 2024-10-25T07:12:52.519Z (3 months ago)
- Topics: dimensional-analysis, math, mathematics, metric-system, physics, units, units-of-measurement, unity, unity3d
- Language: C#
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unit Generator
Generates physics metric units, and performs compile time dimensional analysis
## Compile time dimensional analysis:
Now you don't need to worry about messing up your physics equations
How it works:
you configure the generator and it generates all the units and operations with dimensional analysis already done.
```cs
public static N operator /(W power, mps speed) => new N(power.f / speed.f);
```## Bonus feature - Units in your editor:
Don't worry all the conversions happen in editor.
You can configure whatewer units you want in your editor.
Supports All the physics units: s, kg, m, A, K, mol, cd;
Bonus unit: rad for more efficien conversion from deg to rad in editor.
## How to use:
1. Create UnitGenerator ScriptableObject in a directory where you want to generate the units code.
1. Alternatively you can Copy Packages/com.ovpavlov.unitgenerator/Editor/UnitGeneratorExample.asset for preconfigured generator example
2. Toggle 'Dry Run' and then press 'Generate Button'(which in fact is a Button that looks like a toggle), and check Console to see diagnostics.
3. Untoggle 'Dry Run' and then press 'Generate Button' to generate the code