mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-06-02 02:51:17 +02:00
add doc
This commit is contained in:
parent
7eade29855
commit
226674d30f
@ -133,7 +133,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
- [sphere_spiral_extrude](https://openhome.cc/eGossip/OpenSCAD/lib2x-sphere_spiral_extrude.html)
|
||||
|
||||
### Util
|
||||
- util/angle_between
|
||||
- [util/angle_between](https://openhome.cc/eGossip/OpenSCAD/lib3x-angle_between.html)
|
||||
- [util/bsearch](https://openhome.cc/eGossip/OpenSCAD/lib3x-bsearch.html)
|
||||
- [util/choose](https://openhome.cc/eGossip/OpenSCAD/lib3x-choose.html)
|
||||
- [util/dedup](https://openhome.cc/eGossip/OpenSCAD/lib3x-dedup.html)
|
||||
|
18
docs/lib3x-angle_between.md
Normal file
18
docs/lib3x-angle_between.md
Normal file
@ -0,0 +1,18 @@
|
||||
# angle_between
|
||||
|
||||
Returns the angle between two vectors.
|
||||
|
||||
**Since:** 3.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `vt1` : vector 1.
|
||||
- `vt2` : vector 2.
|
||||
|
||||
## Examples
|
||||
|
||||
use <util/angle_between.scad>;
|
||||
|
||||
assert(angle_between([0, 1], [1, 0]) == 90);
|
||||
assert(angle_between([0, 1, 0], [1, 0, 0]) == 90);
|
||||
assert(round(angle_between([1, 1, 0], [1, 1, sqrt(2)])) == 45);
|
@ -1 +1,11 @@
|
||||
/**
|
||||
* angle_between.scad
|
||||
*
|
||||
* @copyright Justin Lin, 2020
|
||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||
*
|
||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-angle_between.html
|
||||
*
|
||||
**/
|
||||
|
||||
function angle_between(vt1, vt2) = acos((vt1 * vt2) / (norm(vt1) * norm(vt2)));
|
Loading…
x
Reference in New Issue
Block a user