Skip to content

Commit 3f584a5

Browse files
committed
Merge branch 'from_parallel-example' into 'development'
Rotation.from_parallel crystallographic example See merge request damask/DAMASK!1120
2 parents 7892435 + 3508f8e commit 3f584a5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

python/damask/_rotation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,10 @@ def from_parallel(source: np.ndarray,
10761076
"""
10771077
Initialize from pairs of two orthogonal basis vectors.
10781078
1079+
Basis vectors are expressed in a common global frame (active == False)
1080+
or constitute directions that are each expressed in their respective
1081+
frame (active == True).
1082+
10791083
Parameters
10801084
----------
10811085
source : numpy.ndarray, shape (...,2,3)
@@ -1096,12 +1100,20 @@ def from_parallel(source: np.ndarray,
10961100
If rotations $A = [s_1,s_2,s_1 × s_2]^T$ and B = $[t_1,t_2,t_1 × t_2]^T$
10971101
are considered "active", the resulting rotation will be $B^{-1}⋅A$ instead
10981102
of the default result $B⋅A^{-1}$.
1103+
Use of "active" enables the definition of a rotation based on
1104+
two specific directions in each coordinate frame being parallel to each other.
10991105
11001106
Examples
11011107
--------
11021108
>>> import damask
11031109
>>> damask.Rotation.from_parallel([[2,0,0],[0,1,0]],[[1,0,0],[0,2,0]])
11041110
array(( 1., 0., 0., 0.))
1111+
1112+
Direction x and y of the specimen frame are parallel to
1113+
direction [ 1 1 1 ] and [ 1 -1 0 ] of the crystal frame, respectively.
1114+
>>> import damask
1115+
>>> damask.Rotation.from_parallel([[1,0,0],[0,1,0]],[[1,1,1],[1,-1,0]],active=True)
1116+
array((0.1159169 , 0.88047624, 0.3647052 , 0.27984814))
11051117
"""
11061118
s_ = np.array(source,dtype=float)
11071119
t_ = np.array(target,dtype=float)

0 commit comments

Comments
 (0)