Commit 0167f98b authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Merge branch 'MBsysPy_hotFix_algebra' into 'dev'

MbsysPy HotFix algebra

See merge request robotran/mbsysc!411
parents 89a25430 0ee35f5b
...@@ -210,8 +210,9 @@ def cross_product(v1, v2, vres=None, index_1=True): ...@@ -210,8 +210,9 @@ def cross_product(v1, v2, vres=None, index_1=True):
if vres is None: if vres is None:
vres = np.zeros(3 + index_1) vres = np.zeros(3 + index_1)
# For faster reading, terms are aligned. # For faster reading, terms are aligned.
index_1 = int(index_1) # required as array[True] is not array[1]
# For comprenhension: # For comprenhension:
# index_1 alone is index [1] # index_1 is index [1]
# index_1 + 1 is index [2] # index_1 + 1 is index [2]
# index_1 + 2 is index [3] # index_1 + 2 is index [3]
vres[index_1 ] = v1[index_1 + 1] * v2[index_1 + 2] - v1[index_1 + 2] * v2[index_1 + 1] vres[index_1 ] = v1[index_1 + 1] * v2[index_1 + 2] - v1[index_1 + 2] * v2[index_1 + 1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment