diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-08-17 14:58:32 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-24 19:08:20 +0000 |
commit | 0e01759cedcd25868196508177791388b89450e5 (patch) | |
tree | d361152082ad7a92a37d3e5fb9d7981202c40b19 /include/math_util.h | |
parent | de42bb285fa45a777ed7a27be9f4c99c8f606ed8 (diff) | |
download | chrome-ec-0e01759cedcd25868196508177791388b89450e5.tar.gz |
math: Add inverse matrix calculation
Add a slow inverse matrix calculation function.
It is needed to apply factory offset properly.
Also consider the NULL matrix the identity matrix.
BRANCH=smaug,cyan
TEST=Unit test
BUG=chromium:517675
Change-Id: Ifa11954992e6f2fab02b4e92684e7b01bbaafe94
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/294594
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Diffstat (limited to 'include/math_util.h')
-rw-r--r-- | include/math_util.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/math_util.h b/include/math_util.h index 07283cf000..5412655ec3 100644 --- a/include/math_util.h +++ b/include/math_util.h @@ -112,6 +112,13 @@ fp_t cosine_of_angle_diff(const vector_3_t v1, const vector_3_t v2); */ void rotate(const vector_3_t v, const matrix_3x3_t R, vector_3_t res); - +/** + * Rotate vector v by rotation matrix R^-1. + * + * @param v Vector to be rotated. + * @param R Rotation matrix. + * @param res Resultant vector. + */ +void rotate_inv(const vector_3_t v, const matrix_3x3_t R, vector_3_t res); #endif /* __CROS_EC_MATH_UTIL_H */ |