https://github.com/pboymt/py-dimit
Dimension of a quantity in Python language.
https://github.com/pboymt/py-dimit
Last synced: 5 days ago
JSON representation
Dimension of a quantity in Python language.
- Host: GitHub
- URL: https://github.com/pboymt/py-dimit
- Owner: pboymt
- License: gpl-3.0
- Created: 2021-11-30T14:02:03.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T14:54:49.000Z (over 4 years ago)
- Last Synced: 2025-02-24T01:51:36.652Z (over 1 year ago)
- Language: Python
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# py-dimit
Dimension of a quantity in Python language.
## Installation
```bash
$ pip install dimit
# or
$ python -m pip install dimit
```
## Usage
```python
from dimit import Dimension, L, M, T, DIMLESS
# L is a preset dimension for length
Dimension('L') == L
# Output: True
# Build a dimension of velocity (LT^-1).
Velocity = L / T # or L * T**-1
# or
Velocity = Dimension('LT-1')
# Output: Dimension(LT-1)
# Only support operator *, / amd **.
L*L*L == L**3
# Output: True
# Compare two dimensions
Dimension('LMT-2') == Dimension('MLT-2')
# Output: True
```