mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-01-16 13:08:15 +01:00
Typo in comment fixed.
This commit is contained in:
parent
3c370359c8
commit
09d2ffb126
@ -6907,7 +6907,7 @@ Maths utilities for manipulating vectors and matrices.
|
||||
| `coth(x)` | hyperbolic cotangent |
|
||||
| `cubic_real_roots(a, b, c, d)` | Returns real roots of cubic equation |
|
||||
| `degrees(radians)` | Convert degrees to radians |
|
||||
| `euler(R)` | Convert a rotation matrix to a Euler rotation vector. |
|
||||
| `euler(R)` | Convert a rotation matrix to an Euler rotation vector. |
|
||||
| `identity(n, x = 1)` | Construct an arbitrary size identity matrix |
|
||||
| `invert(m)` | Invert a matrix |
|
||||
| `map(v, func)` | make a new vector where the func function argument is applied to each element of the vector v |
|
||||
|
@ -104,7 +104,7 @@ function reverse(v) = let(n = len(v) - 1) n < 0 ? [] : [for(i = [0 : n]) v[n - i
|
||||
function angle_between(v1, v2) = acos(v1 * v2 / (norm(v1) * norm(v2))); //! Return the angle between two vectors
|
||||
|
||||
// http://eecs.qmul.ac.uk/~gslabaugh/publications/euler.pdf
|
||||
function euler(R) = let(ay = asin(-R[2][0]), cy = cos(ay)) //! Convert a rotation matrix to a Euler rotation vector.
|
||||
function euler(R) = let(ay = asin(-R[2][0]), cy = cos(ay)) //! Convert a rotation matrix to an Euler rotation vector.
|
||||
cy ? [ atan2(R[2][1] / cy, R[2][2] / cy), ay, atan2(R[1][0] / cy, R[0][0] / cy) ]
|
||||
: R[2][0] < 0 ? [atan2( R[0][1], R[0][2]), 90, 0]
|
||||
: [atan2(-R[0][1], -R[0][2]), -90, 0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user