Skip to content

Commit

Permalink
Merge branch 'release/v0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Gardner committed May 29, 2018
2 parents 6c2fa5f + a67472c commit 8d42ca4
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 352 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GOPATH=/Users/runeimp/dev/apps/ballistic
VERSION=0.4.2
VERSION=0.5.0
19 changes: 11 additions & 8 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ _build-app:
just build-win32
else
just build-{{os()}}
if [ -d "${HOME}/dev/bin" ]; then
cp bin/{{os()}}/ballistic "${HOME}/dev/bin/"
fi
fi
@build arg='app':
Expand Down Expand Up @@ -234,9 +237,9 @@ _list-dir path='.':

# Run the app
run +args='':
@just term-wipe
@just _run {{args}}
@run +args='':
just term-wipe
just _run {{args}}

@_run +args='':
# BALLISTIC_WEIGHT=grams bin/{{os()}}/ballistic
Expand Down Expand Up @@ -306,15 +309,15 @@ _term-lw label:
term-wipe:
#!/usr/bin/env sh
if [ '{{os()}}' = 'macos' ]; then
just _term-wipe
osascript -e 'tell application "System Events" to keystroke "k" using command down'
elif [ -f `which tput` ]; then
tput reset
elif [ -f `which reset` ]; then
reset
else
just _term-clear
fi
_term-wipe:
#!/usr/bin/osascript
tell application "System Events" to keystroke "k" using command down


# Test all examples
test:
Expand Down
138 changes: 32 additions & 106 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ballistic v0.4.2
Ballistic v0.5.0
================

Command line ballistics calculator
Expand Down Expand Up @@ -66,6 +66,28 @@ $ ballistic --mass 42g --draw-weight 80lb --draw-length 0.72m --json --pretty
}
```

### Calculate initial velocity and MPBR based on projection angel and distance (on a horizontal plan)

```text
$ ballistic -a 45 -d 100m
Projectile Velocity: 790.133355 meters per second
Max Point Blank Range: 239.365366 meters
```

#### Calculate everything by adding projectile mass

```text
$ ballistic -a 45 -d 100m -m 300gr
Projectile Velocity: 790.133355 meters per second
Projectile Energy: 6,068.197170 joules
Projectile Momentum: 15.359932 meter kilogram per second
Max Point Blank Range: 239.365366 meters
```

### Help Info

```text
Expand All @@ -78,17 +100,19 @@ USAGE:
ballistic [global options]
VERSION:
0.4.2
0.5.0
GLOBAL OPTIONS:
--debug, -d Output debug info
--debug, -D Output debug info
--draw-length LENGTH, --length LENGTH, -l LENGTH Bow or sling shot draw LENGTH. Used to calculate projectile velocity, energy, etc.
--draw-weight WEIGHT, --weight WEIGHT, -w WEIGHT Bow or sling shot draw WEIGHT. Used to calculate projectile velocity, energy, etc.
--json, -j Output JSON data
--locale LOCALE, --local LOCALE The LOCALE to format number output for. (default: "en_US") [$LC_CTYPE, $LANG]
--precision PRECISION, --float PRECISION, -f PRECISION The output floating point PRECISION (numbers after decimal mark). (default: "6")
--pretty-print, --pretty, -p Pretty printed JSON output
--projectile MASS, --mass MASS, -m MASS Projectile MASS (weight). Used to calculate projectile velocity, energy, etc.
--projectile-range value, --distance value, -d value The distance the projectile traveled
--projection-angle value, --angle value, -a value The projection angle or trajectory of projectile
--radius RADIUS, -r RADIUS The RADIUS of the target area. Used to calculate MPBR (Maximum Point Blank Range). (default: "225mm")
--velocity VELOCITY, -v VELOCITY The projectile VELOCITY (speed). Used to calculate projectile energy, momentum, etc.
--help, -h Output this help info
Expand All @@ -97,6 +121,9 @@ GLOBAL OPTIONS:
VALUE SUFFIXES:
All input values may be suffixed to allow for broader input selection.
ANGEL
d, deg, degree, degrees
r, rad, radian, radians
LENGTH
c, cm, centi, centimeter, centimeters
f, ft, foot, feet
Expand Down Expand Up @@ -143,7 +170,7 @@ This is my choice over using `make` to facilitates building the binaries and cre
Internationalization/Locale
---------------------------

Ballistic can format the human output numbers per locale norms. It currently checks for locale settings via the environment variables LC_CTYPE and LANG. It also allows you to specify a locale such as `en_CA` or `FR-CA` for English or French Canada for instance or simply `EN` for general English speakers, `DE` the German language or country, etc. via the `--locale` option.
Ballistic can format the human output numbers per locale norms. It currently checks for locale settings via the environment variables `LC_CTYPE` and `LANG`. It also allows you to specify a locale such as `en_CA` or `FR-CA` for English or French Canada for instance or simply `EN` for general English speakers, `DE` the German language or country, etc. via the `--locale` option.

### Locales Supported

Expand Down Expand Up @@ -190,112 +217,11 @@ Here be Dragons! (my research)
- [SI (International System of Units) - Wikipedia][]


### Symbols

| Category | Symbol | Unicode | Decimal | Escape | Numbers | Description |
| :------: | :----: | :-----: | :-----: | :----: | :-----: | ----------- |
| Comma | ' | U+0027 | `'` | `\u0027` | | [Unicode APOSTROPHE][] |
| Comma | , | U+002C | `,` | `\u002C` | ✓ | [Unicode COMMA][] |
| Comma | 𑑍 | U+01144D | `𑑍` | `\u01144D` | | [Unicode NEWA COMMA][] |
| Comma | 𝪇 | U+01DA87 | `𝪇` | `\u01DA87` | | [Unicode SIGNWRITING COMMA][] |
| Comma | ʽ | U+02BD | `ʽ` | `\u02BD` | | [Unicode MODIFIER LETTER REVERSED COMMA][] |
| Comma | ̒ | U+0312 | `̒` | `\u0312` | | [Unicode COMBINING TURNED COMMA ABOVE][] |
| Comma | ̔ | U+0314 | `̔` | `\u0314` | | [Unicode COMBINING REVERSED COMMA ABOVE][] |
| Comma | ̕ | U+0315 | `̕` | `\u0315` | | [Unicode COMBINING COMMA ABOVE RIGHT][] |
| Comma | ، | U+060C | `،` | `\u060C` | | [Unicode ARABIC COMMA][] |
| Comma | ❛ | U+275B | `❛` | `\u275B` | | [Unicode HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT][] |
| Comma | ❜ | U+275C | `❜` | `\u275C` | | [Unicode HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT][] |
| Comma | ⸲ | U+2E32 | `⸲` | `\u2E32` | | [Unicode TURNED COMMA][] |
| Comma | ⸴ | U+2E34 | `⸴` | `\u2E34` | | [Unicode RAISED COMMA][] |
| Comma | ⹁ | U+2E41 | `⹁` | `\u2E41` | | [Unicode REVERSED COMMA][]. Used in Sindhi. |
| Comma | 、 | U+3001 | `、` | `\u3001` | | [Unicode IDEOGRAPHIC COMMA][] |
| Comma | ﹐ | U+FE50 | `﹐` | `\uFE50` | | [Unicode SMALL COMMA][] |
| Comma | ﹑ | U+FE51 | `﹑` | `\uFE51` | | [Unicode SMALL IDEOGRAPHIC COMMA][] |
| Comma | , | U+FF0C | `,` | `\uFF0C` | | [Unicode FULLWIDTH COMMA][] |
| Comma | 、 | U+FF64 | `、` | `\uFF64` | | [Unicode HALFWIDTH IDEOGRAPHIC COMMA][] |
| Decimal Mark | ٫ | U+066B | `٫` | `\u066B` | ✓ | [Unicode ARABIC DECIMAL SEPARATOR][] |
| Decimal Mark | ⎖ | U+2396 | `⎖` | `\u2396` | Keyboard | [Unicode DECIMAL SEPARATOR KEY SYMBOL][]. Noted in [ISO/IEC 9995][ISO/IEC 9995 - Wikipedia] |
| Decimal Mark? | ⸰ | U+2E30 | `⸰` | `\u2E30` | | [Unicode RING POINT][] |
| Group Mark | ٬ | U+066C | `٬` | `\u066C` | ✓ | [Unicode ARABIC THOUSANDS SEPARATOR][] |
| Interpunct | · | U+00B7 | `·` | `\u00B7` | ✓ | [Unicode MIDDLE DOT][] |
| Interpunct | • | U+2022 | `•` | `\u2022` | | [Unicode BULLET][] |
| Interpunct | ‣ | U+2023 | `‣` | `\u2023` | | [Unicode TRIANGULAR BULLET][] |
| Interpunct | ∙ | U+2219 | `∙` | `\u2219` | | [Unicode BULLET OPERATOR][] |
| Interpunct | ⋅ | U+22C5 | `⋅` | `\u22C5` | | [Unicode DOT OPERATOR][] |
| Interpunct | ◦ | U+25E6 | `◦` | `\u25E6` | | [Unicode WHITE BULLET][] |
| Interpunct | ⦁ | U+2981 | `⦁` | `\u2981` | Math | [Unicode Z NOTATION SPOT][] |
| Interpunct | ⸱ | U+2E31 | `⸱` | `\u2E31` | | [Unicode WORD SEPARATOR MIDDLE DOT][] |
| Misc. | 🍀 | U+1F340 | `🍀` | `\u1F340` | | [Unicode FOUR LEAF CLOVER][] |

<!--
| | &#x____; | U+____ | `&#____;` | `\u____` | | [] |
| | &#x____; | U+____ | `&#____;` | `\u____` | | [] |
| | &#x____; | U+____ | `&#____;` | `\u____` | | [] |
| | &#x____; | U+____ | `&#____;` | `\u____` | | [] |
| | &#x____; | U+____ | `&#____;` | `\u____` | | [] |
-->



### Formulas

Note: These formulas are here for my tracking purposes. They are not necessarily used in the app.

```
PE = mass * gravity * height
Energy = pressure * volume / efficiency
```

PE = Potential Energy


- [PSI to Energy][]


<!--
[Unicode ____]: https://www.fileformat.info/info/unicode/char/____/
[Unicode ____]: https://www.fileformat.info/info/unicode/char/____/
[Unicode ____]: https://www.fileformat.info/info/unicode/char/____/
-->

[`just`]: https://github.com/casey/just
[Decimal Separator - Wikipedia]: https://en.wikipedia.org/wiki/Decimal_separator
[ISO/IEC 9995 - Wikipedia]: https://en.wikipedia.org/wiki/ISO/IEC_9995
[Decimal and Thousands Separators (International Language Environments Guide)]: https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/
[SI (International System of Units) - Wikipedia]: https://en.wikipedia.org/wiki/International_System_of_Units
[ISO 31-0: Numbers - Wikipedia]: https://en.wikipedia.org/wiki/ISO_31-0#Numbers
[PSI to Energy]: https://www.physicsforums.com/threads/psi-to-kw-conversion.700882/
[Unicode APOSTROPHE]: https://www.fileformat.info/info/unicode/char/0027/
[Unicode ARABIC COMMA]: https://www.fileformat.info/info/unicode/char/060C/
[Unicode ARABIC DECIMAL SEPARATOR]: https://www.fileformat.info/info/unicode/char/066B/
[Unicode ARABIC THOUSANDS SEPARATOR]: https://www.fileformat.info/info/unicode/char/066C/
[Unicode BULLET OPERATOR]: https://www.fileformat.info/info/unicode/char/2219/
[Unicode BULLET]: https://www.fileformat.info/info/unicode/char/2022/
[Unicode COMBINING COMMA ABOVE RIGHT]: https://www.fileformat.info/info/unicode/char/0315/
[Unicode COMBINING REVERSED COMMA ABOVE]: https://www.fileformat.info/info/unicode/char/0314/
[Unicode COMBINING TURNED COMMA ABOVE]: https://www.fileformat.info/info/unicode/char/0312/
[Unicode COMMA]: https://www.fileformat.info/info/unicode/char/002C/
[Unicode DECIMAL SEPARATOR KEY SYMBOL]: https://www.fileformat.info/info/unicode/char/2396/
[Unicode DOT OPERATOR]: https://www.fileformat.info/info/unicode/char/22C5/
[Unicode FOUR LEAF CLOVER]: https://www.fileformat.info/info/unicode/char/1F340/
[Unicode FULLWIDTH COMMA]: https://www.fileformat.info/info/unicode/char/FF0C/
[Unicode HALFWIDTH IDEOGRAPHIC COMMA]: https://www.fileformat.info/info/unicode/char/FF64/
[Unicode HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT]: https://www.fileformat.info/info/unicode/char/275C/
[Unicode HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT]: https://www.fileformat.info/info/unicode/char/275B/
[Unicode IDEOGRAPHIC COMMA]: https://www.fileformat.info/info/unicode/char/3001/
[Unicode MIDDLE DOT]: https://www.fileformat.info/info/unicode/char/00B7/
[Unicode MODIFIER LETTER REVERSED COMMA]: https://www.fileformat.info/info/unicode/char/02BD/
[Unicode NEWA COMMA]: https://www.fileformat.info/info/unicode/char/1144D/
[Unicode RAISED COMMA]: https://www.fileformat.info/info/unicode/char/2E34/
[Unicode REVERSED COMMA]: https://www.fileformat.info/info/unicode/char/2E41/
[Unicode RING POINT]: https://www.fileformat.info/info/unicode/char/2E30/
[Unicode SIGNWRITING COMMA]: https://www.fileformat.info/info/unicode/char/1DA87/
[Unicode SMALL COMMA]: https://www.fileformat.info/info/unicode/char/FE50/
[Unicode SMALL IDEOGRAPHIC COMMA]: https://www.fileformat.info/info/unicode/char/FE51/
[Unicode TRIANGULAR BULLET]: https://www.fileformat.info/info/unicode/char/2023/
[Unicode TURNED COMMA]: https://www.fileformat.info/info/unicode/char/2E32/
[Unicode WHITE BULLET]: https://www.fileformat.info/info/unicode/char/25E6/
[Unicode WORD SEPARATOR MIDDLE DOT]: https://www.fileformat.info/info/unicode/char/2E31/
[Unicode Z NOTATION SPOT]: https://www.fileformat.info/info/unicode/char/2981/


Loading

0 comments on commit 8d42ca4

Please sign in to comment.