2016-08-03 15:01:27 +00:00
|
|
|
# Rink
|
|
|
|
|
2016-09-07 02:18:34 +00:00
|
|
|
Rink is a unit-aware calculator. It can be used for physics and
|
|
|
|
engineering calculations, as well as dimensionality analysis.
|
|
|
|
|
|
|
|
Rink supports most systems of measurements including SI, CGS, natural,
|
|
|
|
international customary, US customary, UK customary, as well as
|
2016-09-20 17:29:16 +00:00
|
|
|
historical measurements. In addition, Rink supports currency
|
|
|
|
conversions.
|
2016-09-07 02:18:34 +00:00
|
|
|
|
|
|
|
Unique features:
|
2016-08-03 15:01:27 +00:00
|
|
|
|
2016-08-07 18:08:26 +00:00
|
|
|
- High-precision bignum rational arithmetic
|
|
|
|
- Detailed error messages
|
2016-09-07 02:18:34 +00:00
|
|
|
- Shows SI physical quantities
|
|
|
|
- Finds applicable SI derived units automatically
|
|
|
|
- Helps with dimensionality analysis, such as by offering unit
|
|
|
|
factorizations and finding units for quantities.
|
|
|
|
- Open source
|
|
|
|
- First-class support for non-absolute temperature scales
|
|
|
|
|
|
|
|
## [Manual](https://github.com/tiffany352/rink-rs/wiki/Rink-Manual)
|
|
|
|
|
|
|
|
Describes (hopefully) everything you need to know to use Rink's
|
|
|
|
expression language.
|
|
|
|
|
|
|
|
## [Web Interface](https://tiffnix.com/rink/)
|
|
|
|
|
|
|
|
Rink is available via the web, so that you don't have to install it.
|
2016-08-07 18:08:26 +00:00
|
|
|
|
2016-08-03 15:01:27 +00:00
|
|
|
## Install
|
|
|
|
|
|
|
|
`cargo install rink`
|
|
|
|
|
2016-09-07 02:18:34 +00:00
|
|
|
Running `rink` will give you a CLI interface for you to enter queries.
|
|
|
|
|
2016-08-03 15:01:27 +00:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
```
|
|
|
|
> kWh/year -> W
|
2016-09-07 02:18:34 +00:00
|
|
|
0.1140795 watt (power)
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
> W -> J
|
2016-09-07 02:18:34 +00:00
|
|
|
Conformance error: 1 watt (power) != 1 joule (energy)
|
|
|
|
Suggestions: multiply left side by time, multiply right side by frequency
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```
|
2016-08-22 02:26:04 +00:00
|
|
|
> gallon gasoline -> kWh
|
|
|
|
approx. 36.63388 kWh (energy)
|
2016-08-07 18:08:26 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
> googol^100
|
|
|
|
1.0e10000 (dimensionless)
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
2016-08-03 18:27:36 +00:00
|
|
|
## Library Usage
|
2016-08-03 15:01:27 +00:00
|
|
|
|
|
|
|
Add this to your `Cargo.toml`:
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[dependencies]
|
2016-08-26 22:09:30 +00:00
|
|
|
rink = "0.3"
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
and this to your crate root:
|
|
|
|
|
|
|
|
```rust
|
2016-08-03 15:04:40 +00:00
|
|
|
extern crate rink;
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
2016-08-22 14:46:22 +00:00
|
|
|
Rink source code is licensed under the Mozilla Public License, version
|
|
|
|
2. See [LICENSE-MPL](./LICENSE-MPL) for details.
|
2016-08-03 15:01:27 +00:00
|
|
|
|
2016-08-22 14:46:22 +00:00
|
|
|
The data file `definitions.units` is licensed under the GNU General
|
|
|
|
Public License, version 3. See [LICENSE-GPL](./LICENSE-GPL) for details.
|
2016-08-03 15:01:27 +00:00
|
|
|
|
|
|
|
### Contribution
|
|
|
|
|
|
|
|
Unless you explicitly state otherwise, any contribution intentionally
|
2016-08-22 14:46:22 +00:00
|
|
|
submitted for inclusion in the work will grant the rights lined out in
|
|
|
|
the MPL, including larger works with secondary licenses.
|
2016-08-07 18:08:26 +00:00
|
|
|
|
|
|
|
## Changelog
|
|
|
|
|
2016-09-20 17:29:16 +00:00
|
|
|
### 0.3.2
|
|
|
|
- Time quantities now automatically display in human units (year,
|
|
|
|
week, day, hour, minute, second)
|
|
|
|
- Currency conversions sourced from the European Central Bank, and the
|
|
|
|
BTC-E bitcoin exchange
|
|
|
|
- Move all element units from being dimensionless to being g/mol
|
|
|
|
(molar mass)
|
|
|
|
- Add atomic masses for elements 104 (rutherfordium) through 118
|
|
|
|
(ununoctium)
|
|
|
|
- Add more date patterns and make them less strict
|
|
|
|
- Allow durations larger than ~200 years
|
|
|
|
- Fix viscosity quantity dimensionality
|
|
|
|
- Time offset conversions
|
|
|
|
- Fix bugs in date parser
|
|
|
|
|
2016-09-08 15:32:46 +00:00
|
|
|
### 0.3.1
|
|
|
|
- Automatically find SI prefixes
|
|
|
|
- Limit to one prefix on units to prevent very unintuitive results
|
|
|
|
- Switch to linefeed from rustyline
|
|
|
|
- Tab completion
|
|
|
|
- Fix a serious number printing bug
|
|
|
|
- Significantly improve canonicalizations
|
|
|
|
- Constants in right-hand side of conversions
|
|
|
|
- New quantities
|
|
|
|
- Fix parsec definition
|
|
|
|
- Reintroduce jerk, snap, crackle, and pop
|
|
|
|
- Added π, ¢, and ħ symbols
|
|
|
|
- Better determinism by removing hashmaps
|
|
|
|
- Typo suggestions
|
|
|
|
- Simple unit namespacing allowing for things like "british foot"
|
|
|
|
- Minor error message improvements
|
|
|
|
- Refactors
|
|
|
|
- Russian traditional measurements
|
|
|
|
|
2016-08-26 22:09:30 +00:00
|
|
|
### 0.3.0
|
|
|
|
- Use GNU units database instead of frink's
|
|
|
|
- Relicense under MPL
|
|
|
|
- Web interface
|
|
|
|
- Multi-server IRC in bot
|
|
|
|
- Date arithmetic
|
|
|
|
- Exact fraction printing
|
|
|
|
- Sandboxing
|
|
|
|
- Add temperature scale suffixes
|
|
|
|
- Factorize query
|
|
|
|
- Function call syntax
|
|
|
|
- Errors on division by zero
|
|
|
|
- Errors on unimplemented imaginary roots
|
|
|
|
- Inline unit definitions
|
|
|
|
- Bot name prefix is optional in private message
|
|
|
|
- Fix associativity of addition
|
|
|
|
- Rename commonly confused units
|
|
|
|
- Unit lists (hr;min;sec) in conversions
|
|
|
|
- "Units for" query
|
|
|
|
- Show unit definitions when they are the only term
|
|
|
|
- Make / lower precedence than multiplication, add | which is higher
|
|
|
|
precedence
|
|
|
|
- Unit tests
|
|
|
|
- Output token symbols instead of internal names
|
|
|
|
- Canonicalize output units
|
|
|
|
- Try to find a matching derived unit for queries
|
|
|
|
|
2016-08-07 18:08:26 +00:00
|
|
|
### 0.2.0
|
|
|
|
- Errors for division by zero
|
|
|
|
- Better conversion (->) output
|
|
|
|
- Bignum arithmetic
|
|
|
|
- API docs
|
|
|
|
- IRC bot
|
|
|
|
- Addition
|
|
|
|
|
|
|
|
### 0.1.1
|
|
|
|
- Search for units.txt in standard directories
|
|
|
|
- Rustyline
|
|
|
|
|
|
|
|
### 0.1.0
|
|
|
|
- Initial release
|