Skip to content

Commit

Permalink
add documentation to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lucalewin committed Apr 1, 2023
1 parent f9436a6 commit 188c479
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# Measurement

Adds quantities and units to rust to allow unit safe computation

## Define new quantity

### Base Quantity

```rust
quantity! {
name: Time,
base_unit: Second,
units: {
Second: 1e+0,
Millisecond: 1e-3,
}
}
```

### Derived Quantity

```rust
quantity! {
name: Velocity,
base_unit: MeterPerSecond,
units: {
MeterPerSecond: 1,
KilometerPerHour: 3.6,
},
derive: Length / Time,
}
```

0 comments on commit 188c479

Please sign in to comment.