From 2b2c69a6ef690af0e2bcb637a3100f002c5c1d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Wiik=20=C3=85nes?= Date: Sat, 22 Apr 2023 16:59:15 +0200 Subject: [PATCH] Correct statement about combining transformations in example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- .../misorientation_from_aligning_directions.py | 4 ++-- orix/quaternion/quaternion.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/misorientations/misorientation_from_aligning_directions.py b/examples/misorientations/misorientation_from_aligning_directions.py index d027d17b..93127677 100644 --- a/examples/misorientations/misorientation_from_aligning_directions.py +++ b/examples/misorientations/misorientation_from_aligning_directions.py @@ -33,9 +33,9 @@ [1, 3, 2], 90, symmetry=phase2.point_group, degrees=True ) -# Get the reference misorientation (goal). Transformations are composed +# Get the reference misorientation (goal). Misorientations are obtained # from the right, so: crystal 1 -> sample -> crystal 2 -m_ref = Misorientation(o2 * (~o1), symmetry=(o1.symmetry, o2.symmetry)) +m_ref = Misorientation(o2 * ~o1, symmetry=(o1.symmetry, o2.symmetry)) # Specify two directions in the first crystal v_c1 = Miller(uvw=[[1, 1, 1], [0, 0, 1]], phase=phase1) diff --git a/orix/quaternion/quaternion.py b/orix/quaternion/quaternion.py index 472dd58f..19e0624d 100644 --- a/orix/quaternion/quaternion.py +++ b/orix/quaternion/quaternion.py @@ -49,13 +49,13 @@ class Quaternion(Object3d): with :math:`q_3 = (a_3, b_3, c_3, d_3) = q_1 \cdot q_2` follows as: .. math:: - a_3 = (a_1 \cdot a_2 - b_1 \cdot b_2 - c_1 \cdot c_2 - d_1 \cdot d_2) + a_3 = a_1 \cdot a_2 - b_1 \cdot b_2 - c_1 \cdot c_2 - d_1 \cdot d_2 - b_3 = (a_1 \cdot b_2 + b_1 \cdot a_2 + c_1 \cdot d_2 - d_1 \cdot c_2) + b_3 = a_1 \cdot b_2 + b_1 \cdot a_2 + c_1 \cdot d_2 - d_1 \cdot c_2 - c_3 = (a_1 \cdot c_2 - b_1 \cdot d_2 + c_1 \cdot a_2 + d_1 \cdot b_2) + c_3 = a_1 \cdot c_2 - b_1 \cdot d_2 + c_1 \cdot a_2 + d_1 \cdot b_2 - d_3 = (a_1 \cdot d_2 + b_1 \cdot c_2 - c_1 \cdot b_2 + d_1 \cdot a_2) + d_3 = a_1 \cdot d_2 + b_1 \cdot c_2 - c_1 \cdot b_2 + d_1 \cdot a_2 Quaternion-vector multiplication with a three-dimensional vector :math:`v = (x, y, z)` calculates a rotated vector