From 09d2ffb126cf9d9ad2d68171583e11708227b704 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 22 Jul 2023 19:32:42 +0100 Subject: [PATCH] Typo in comment fixed. --- readme.md | 2 +- utils/maths.scad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 398bc9c..31e83d7 100644 --- a/readme.md +++ b/readme.md @@ -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 | diff --git a/utils/maths.scad b/utils/maths.scad index c4d6b64..3d03f47 100644 --- a/utils/maths.scad +++ b/utils/maths.scad @@ -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];