Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
L_3 = vstack((L1_3, L2_3, -L1_3, L2_3))
Bzu = multiply_matrix_vector_numba(B, z_u)
Byu = multiply_matrix_vector_numba(B, y_u)
Bzv = multiply_matrix_vector_numba(B, z_v)
Byv = multiply_matrix_vector_numba(B, y_v)
h_1 = hstack((zero3, (multiply_matrix_vector_numba(-Szu, y_e) + multiply_matrix_vector_numba(Syu, z_e)), zero6))
h_2 = hstack((Bzu, (multiply_matrix_vector_numba(-Szu, x_e) + multiply_matrix_vector_numba(Sxu, z_e)), -Bzu, zero3))
h_3 = hstack((Byu, (multiply_matrix_vector_numba(-Syu, x_e) + multiply_matrix_vector_numba(Sxu, y_e)), -Byu, zero3))
h_4 = hstack((zero9, (multiply_matrix_vector_numba(-Szv, y_e) + multiply_matrix_vector_numba(Syv, z_e))))
h_5 = hstack((Bzv, zero3, -Bzv, (multiply_matrix_vector_numba(-Szv, x_e) + multiply_matrix_vector_numba(Sxv, z_e))))
h_6 = hstack((Byv, zero3, -Byv, (multiply_matrix_vector_numba(-Syv, x_e) + multiply_matrix_vector_numba(Sxv, y_e))))
t_1 = (multiply_matrix_vector_numba(L_3, y_u) - multiply_matrix_vector_numba(L_2, z_u) + h_1) / (2 * cos(theta[0]))
t_2 = (multiply_matrix_vector_numba(L_3, x_u) + h_2) / (2 * cos(theta[2]))
t_3 = (multiply_matrix_vector_numba(L_2, x_u) + h_3) / (2 * cos(theta[4]))
t_4 = (multiply_matrix_vector_numba(L_3, y_v) - multiply_matrix_vector_numba(L_2, z_v) + h_4) / (2 * cos(theta[1]))
t_5 = (multiply_matrix_vector_numba(L_3, x_v) + h_5) / (2 * cos(theta[3]))
t_6 = (multiply_matrix_vector_numba(L_2, x_v) + h_6) / (2 * cos(theta[5]))
g = hstack((-x_e, zero3, x_e, zero3))
T = zeros((12, 7))
T[:, 0] = g
T[:, 1] = t_1
T[:, 2] = t_2
T[:, 3] = t_3
T[:, 4] = t_4
T[:, 5] = t_5
T[:, 6] = t_6
xe_Re[0, :] = xe + Re[:, 0]
B = 1. / li[0] * (eye3 - mdotm(xe_t, xe_t.transpose()))
k = mdotm(xe_t, xe_Re)
Re1xe = vdotv(Re[:, 1], xe)
Re2xe = vdotv(Re[:, 2], xe)
L1_2 = 0.5 * Re1xe * B + mdotm(0.5 * B, mdotm(Re1_t, xe_Re))
L1_3 = 0.5 * Re2xe * B + mdotm(0.5 * B, mdotm(Re2_t, xe_Re))
L2_2 = 0.5 * Sr1 - 0.25 * Re1xe * Sr0 - mdotm(0.25 * Sr1, k)
L2_3 = 0.5 * Sr2 - 0.25 * Re2xe * Sr0 - mdotm(0.25 * Sr2, k)
L2 = vstack((L1_2, L2_2, -L1_2, L2_2))
L3 = vstack((L1_3, L2_3, -L1_3, L2_3))
Bzu = mdotv(B, zu)
Byu = mdotv(B, yu)
Bzv = mdotv(B, zv)
Byv = mdotv(B, yv)
h1 = hstack((zero3, (mdotv(-Szu, ye) + mdotv(Syu, ze)), zero6))
h2 = hstack((Bzu, (mdotv(-Szu, xe) + mdotv(Sxu, ze)), -Bzu, zero3))
h3 = hstack((Byu, (mdotv(-Syu, xe) + mdotv(Sxu, ye)), -Byu, zero3))
h4 = hstack((zero9, (mdotv(-Szv, ye) + mdotv(Syv, ze))))
h5 = hstack((Bzv, zero3, -Bzv, (mdotv(-Szv, xe) + mdotv(Sxv, ze))))
h6 = hstack((Byv, zero3, -Byv, (mdotv(-Syv, xe) + mdotv(Sxv, ye))))
T = zeros((12, 7))
T[:, 0] = hstack((-xe, zero3, xe, zero3))
T[:, 1] = (mdotv(L3, yu) - mdotv(L2, zu) + h1) / (2 * cos(theta[0]))
T[:, 2] = (mdotv(L3, xu) + h2) / (2 * cos(theta[2]))
T[:, 3] = (mdotv(L2, xu) + h3) / (2 * cos(theta[4]))
T[:, 4] = (mdotv(L3, yv) - mdotv(L2, zv) + h4) / (2 * cos(theta[1]))
R_e2_t[1, 0] = R_e[1, 2]
R_e2_t[2, 0] = R_e[2, 2]
B = 1. / li[0] * (eye3 - multiply_matrices_numba(x_e_t, x_e_h))
XX = multiply_matrices_numba(x_e_t, xe_Re0)
L1_2 = 0.5 * dot_vectors_numba(R_e[:, 1], x_e) * B + multiply_matrices_numba(0.5 * B, multiply_matrices_numba(R_e1_t, xe_Re0))
L1_3 = 0.5 * dot_vectors_numba(R_e[:, 2], x_e) * B + multiply_matrices_numba(0.5 * B, multiply_matrices_numba(R_e2_t, xe_Re0))
L2_2 = 0.5 * Sr1 - 0.25 * dot_vectors_numba(R_e[:, 1], x_e) * Sr0 - multiply_matrices_numba(0.25 * Sr1, XX)
L2_3 = 0.5 * Sr2 - 0.25 * dot_vectors_numba(R_e[:, 2], x_e) * Sr0 - multiply_matrices_numba(0.25 * Sr2, XX)
L_2 = vstack((L1_2, L2_2, -L1_2, L2_2))
L_3 = vstack((L1_3, L2_3, -L1_3, L2_3))
Bzu = multiply_matrix_vector_numba(B, z_u)
Byu = multiply_matrix_vector_numba(B, y_u)
Bzv = multiply_matrix_vector_numba(B, z_v)
Byv = multiply_matrix_vector_numba(B, y_v)
h_1 = hstack((zero3, (multiply_matrix_vector_numba(-Szu, y_e) + multiply_matrix_vector_numba(Syu, z_e)), zero6))
h_2 = hstack((Bzu, (multiply_matrix_vector_numba(-Szu, x_e) + multiply_matrix_vector_numba(Sxu, z_e)), -Bzu, zero3))
h_3 = hstack((Byu, (multiply_matrix_vector_numba(-Syu, x_e) + multiply_matrix_vector_numba(Sxu, y_e)), -Byu, zero3))
h_4 = hstack((zero9, (multiply_matrix_vector_numba(-Szv, y_e) + multiply_matrix_vector_numba(Syv, z_e))))
h_5 = hstack((Bzv, zero3, -Bzv, (multiply_matrix_vector_numba(-Szv, x_e) + multiply_matrix_vector_numba(Sxv, z_e))))
h_6 = hstack((Byv, zero3, -Byv, (multiply_matrix_vector_numba(-Syv, x_e) + multiply_matrix_vector_numba(Sxv, y_e))))
t_1 = (multiply_matrix_vector_numba(L_3, y_u) - multiply_matrix_vector_numba(L_2, z_u) + h_1) / (2 * cos(theta[0]))
t_2 = (multiply_matrix_vector_numba(L_3, x_u) + h_2) / (2 * cos(theta[2]))
t_3 = (multiply_matrix_vector_numba(L_2, x_u) + h_3) / (2 * cos(theta[4]))
t_4 = (multiply_matrix_vector_numba(L_3, y_v) - multiply_matrix_vector_numba(L_2, z_v) + h_4) / (2 * cos(theta[1]))
t_5 = (multiply_matrix_vector_numba(L_3, x_v) + h_5) / (2 * cos(theta[3]))
t_6 = (multiply_matrix_vector_numba(L_2, x_v) + h_6) / (2 * cos(theta[5]))
Byv = mdotv(B, yv)
h1 = hstack((zero3, (mdotv(-Szu, ye) + mdotv(Syu, ze)), zero6))
h2 = hstack((Bzu, (mdotv(-Szu, xe) + mdotv(Sxu, ze)), -Bzu, zero3))
h3 = hstack((Byu, (mdotv(-Syu, xe) + mdotv(Sxu, ye)), -Byu, zero3))
h4 = hstack((zero9, (mdotv(-Szv, ye) + mdotv(Syv, ze))))
h5 = hstack((Bzv, zero3, -Bzv, (mdotv(-Szv, xe) + mdotv(Sxv, ze))))
h6 = hstack((Byv, zero3, -Byv, (mdotv(-Syv, xe) + mdotv(Sxv, ye))))
T = zeros((12, 7))
T[:, 0] = hstack((-xe, zero3, xe, zero3))
T[:, 1] = (mdotv(L3, yu) - mdotv(L2, zu) + h1) / (2 * cos(theta[0]))
T[:, 2] = (mdotv(L3, xu) + h2) / (2 * cos(theta[2]))
T[:, 3] = (mdotv(L2, xu) + h3) / (2 * cos(theta[4]))
T[:, 4] = (mdotv(L3, yv) - mdotv(L2, zv) + h4) / (2 * cos(theta[1]))
T[:, 5] = (mdotv(L3, xv) + h5) / (2 * cos(theta[3]))
T[:, 6] = (mdotv(L2, xv) + h6) / (2 * cos(theta[5]))
return T, L2, L3, B
xe_Re[0, :] = xe + Re[:, 0]
B = 1. / li[0] * (eye3 - mdotm(xe_t, xe_t.transpose()))
k = mdotm(xe_t, xe_Re)
Re1xe = vdotv(Re[:, 1], xe)
Re2xe = vdotv(Re[:, 2], xe)
L1_2 = 0.5 * Re1xe * B + mdotm(0.5 * B, mdotm(Re1_t, xe_Re))
L1_3 = 0.5 * Re2xe * B + mdotm(0.5 * B, mdotm(Re2_t, xe_Re))
L2_2 = 0.5 * Sr1 - 0.25 * Re1xe * Sr0 - mdotm(0.25 * Sr1, k)
L2_3 = 0.5 * Sr2 - 0.25 * Re2xe * Sr0 - mdotm(0.25 * Sr2, k)
L2 = vstack((L1_2, L2_2, -L1_2, L2_2))
L3 = vstack((L1_3, L2_3, -L1_3, L2_3))
# print(L2.shape, L3.shape)
Bzu = mdotv(B, zu)
Byu = mdotv(B, yu)
Bzv = mdotv(B, zv)
Byv = mdotv(B, yv)
h1 = hstack((zero3, (mdotv(-Szu, ye) + mdotv(Syu, ze)), zero6))
h2 = hstack((Bzu, (mdotv(-Szu, xe) + mdotv(Sxu, ze)), -Bzu, zero3))
h3 = hstack((Byu, (mdotv(-Syu, xe) + mdotv(Sxu, ye)), -Byu, zero3))
h4 = hstack((zero9, (mdotv(-Szv, ye) + mdotv(Syv, ze))))
h5 = hstack((Bzv, zero3, -Bzv, (mdotv(-Szv, xe) + mdotv(Sxv, ze))))
h6 = hstack((Byv, zero3, -Byv, (mdotv(-Syv, xe) + mdotv(Sxv, ye))))
T = zeros((12, 7))
T[:, 0] = hstack((-xe, zero3, xe, zero3))
T[:, 1] = (mdotv(L3, yu) - mdotv(L2, zu) + h1) / (2 * cos(theta[0]))
T[:, 2] = (mdotv(L3, xu) + h2) / (2 * cos(theta[2]))
T[:, 3] = (mdotv(L2, xu) + h3) / (2 * cos(theta[4]))
R_e2_t[0, 0] = R_e[0, 2]
R_e2_t[1, 0] = R_e[1, 2]
R_e2_t[2, 0] = R_e[2, 2]
B = 1. / li[0] * (eye3 - multiply_matrices_numba(x_e_t, x_e_h))
XX = multiply_matrices_numba(x_e_t, xe_Re0)
L1_2 = 0.5 * dot_vectors_numba(R_e[:, 1], x_e) * B + multiply_matrices_numba(0.5 * B, multiply_matrices_numba(R_e1_t, xe_Re0))
L1_3 = 0.5 * dot_vectors_numba(R_e[:, 2], x_e) * B + multiply_matrices_numba(0.5 * B, multiply_matrices_numba(R_e2_t, xe_Re0))
L2_2 = 0.5 * Sr1 - 0.25 * dot_vectors_numba(R_e[:, 1], x_e) * Sr0 - multiply_matrices_numba(0.25 * Sr1, XX)
L2_3 = 0.5 * Sr2 - 0.25 * dot_vectors_numba(R_e[:, 2], x_e) * Sr0 - multiply_matrices_numba(0.25 * Sr2, XX)
L_2 = vstack((L1_2, L2_2, -L1_2, L2_2))
L_3 = vstack((L1_3, L2_3, -L1_3, L2_3))
Bzu = multiply_matrix_vector_numba(B, z_u)
Byu = multiply_matrix_vector_numba(B, y_u)
Bzv = multiply_matrix_vector_numba(B, z_v)
Byv = multiply_matrix_vector_numba(B, y_v)
h_1 = hstack((zero3, (multiply_matrix_vector_numba(-Szu, y_e) + multiply_matrix_vector_numba(Syu, z_e)), zero6))
h_2 = hstack((Bzu, (multiply_matrix_vector_numba(-Szu, x_e) + multiply_matrix_vector_numba(Sxu, z_e)), -Bzu, zero3))
h_3 = hstack((Byu, (multiply_matrix_vector_numba(-Syu, x_e) + multiply_matrix_vector_numba(Sxu, y_e)), -Byu, zero3))
h_4 = hstack((zero9, (multiply_matrix_vector_numba(-Szv, y_e) + multiply_matrix_vector_numba(Syv, z_e))))
h_5 = hstack((Bzv, zero3, -Bzv, (multiply_matrix_vector_numba(-Szv, x_e) + multiply_matrix_vector_numba(Sxv, z_e))))
h_6 = hstack((Byv, zero3, -Byv, (multiply_matrix_vector_numba(-Syv, x_e) + multiply_matrix_vector_numba(Sxv, y_e))))
t_1 = (multiply_matrix_vector_numba(L_3, y_u) - multiply_matrix_vector_numba(L_2, z_u) + h_1) / (2 * cos(theta[0]))
t_2 = (multiply_matrix_vector_numba(L_3, x_u) + h_2) / (2 * cos(theta[2]))
t_3 = (multiply_matrix_vector_numba(L_2, x_u) + h_3) / (2 * cos(theta[4]))
t_4 = (multiply_matrix_vector_numba(L_3, y_v) - multiply_matrix_vector_numba(L_2, z_v) + h_4) / (2 * cos(theta[1]))
t_5 = (multiply_matrix_vector_numba(L_3, x_v) + h_5) / (2 * cos(theta[3]))
L1_2 = 0.5 * Re1xe * B + mdotm(0.5 * B, mdotm(Re1_t, xe_Re))
L1_3 = 0.5 * Re2xe * B + mdotm(0.5 * B, mdotm(Re2_t, xe_Re))
L2_2 = 0.5 * Sr1 - 0.25 * Re1xe * Sr0 - mdotm(0.25 * Sr1, k)
L2_3 = 0.5 * Sr2 - 0.25 * Re2xe * Sr0 - mdotm(0.25 * Sr2, k)
L2 = vstack((L1_2, L2_2, -L1_2, L2_2))
L3 = vstack((L1_3, L2_3, -L1_3, L2_3))
# print(L2.shape, L3.shape)
Bzu = mdotv(B, zu)
Byu = mdotv(B, yu)
Bzv = mdotv(B, zv)
Byv = mdotv(B, yv)
h1 = hstack((zero3, (mdotv(-Szu, ye) + mdotv(Syu, ze)), zero6))
h2 = hstack((Bzu, (mdotv(-Szu, xe) + mdotv(Sxu, ze)), -Bzu, zero3))
h3 = hstack((Byu, (mdotv(-Syu, xe) + mdotv(Sxu, ye)), -Byu, zero3))
h4 = hstack((zero9, (mdotv(-Szv, ye) + mdotv(Syv, ze))))
h5 = hstack((Bzv, zero3, -Bzv, (mdotv(-Szv, xe) + mdotv(Sxv, ze))))
h6 = hstack((Byv, zero3, -Byv, (mdotv(-Syv, xe) + mdotv(Sxv, ye))))
T = zeros((12, 7))
T[:, 0] = hstack((-xe, zero3, xe, zero3))
T[:, 1] = (mdotv(L3, yu) - mdotv(L2, zu) + h1) / (2 * cos(theta[0]))
T[:, 2] = (mdotv(L3, xu) + h2) / (2 * cos(theta[2]))
T[:, 3] = (mdotv(L2, xu) + h3) / (2 * cos(theta[4]))
T[:, 4] = (mdotv(L3, yv) - mdotv(L2, zv) + h4) / (2 * cos(theta[1]))
T[:, 5] = (mdotv(L3, xv) + h5) / (2 * cos(theta[3]))
T[:, 6] = (mdotv(L2, xv) + h6) / (2 * cos(theta[5]))
return T, L2, L3, B
Byu = mdotv(B, yu)
Bzv = mdotv(B, zv)
Byv = mdotv(B, yv)
h1 = hstack((zero3, (mdotv(-Szu, ye) + mdotv(Syu, ze)), zero6))
h2 = hstack((Bzu, (mdotv(-Szu, xe) + mdotv(Sxu, ze)), -Bzu, zero3))
h3 = hstack((Byu, (mdotv(-Syu, xe) + mdotv(Sxu, ye)), -Byu, zero3))
h4 = hstack((zero9, (mdotv(-Szv, ye) + mdotv(Syv, ze))))
h5 = hstack((Bzv, zero3, -Bzv, (mdotv(-Szv, xe) + mdotv(Sxv, ze))))
h6 = hstack((Byv, zero3, -Byv, (mdotv(-Syv, xe) + mdotv(Sxv, ye))))
T = zeros((12, 7))
T[:, 0] = hstack((-xe, zero3, xe, zero3))
T[:, 1] = (mdotv(L3, yu) - mdotv(L2, zu) + h1) / (2 * cos(theta[0]))
T[:, 2] = (mdotv(L3, xu) + h2) / (2 * cos(theta[2]))
T[:, 3] = (mdotv(L2, xu) + h3) / (2 * cos(theta[4]))
T[:, 4] = (mdotv(L3, yv) - mdotv(L2, zv) + h4) / (2 * cos(theta[1]))
T[:, 5] = (mdotv(L3, xv) + h5) / (2 * cos(theta[3]))
T[:, 6] = (mdotv(L2, xv) + h6) / (2 * cos(theta[5]))
return T, L2, L3, B
L1_3 = 0.5 * dot_vectors_numba(R_e[:, 2], x_e) * B + multiply_matrices_numba(0.5 * B, multiply_matrices_numba(R_e2_t, xe_Re0))
L2_2 = 0.5 * Sr1 - 0.25 * dot_vectors_numba(R_e[:, 1], x_e) * Sr0 - multiply_matrices_numba(0.25 * Sr1, XX)
L2_3 = 0.5 * Sr2 - 0.25 * dot_vectors_numba(R_e[:, 2], x_e) * Sr0 - multiply_matrices_numba(0.25 * Sr2, XX)
L_2 = vstack((L1_2, L2_2, -L1_2, L2_2))
L_3 = vstack((L1_3, L2_3, -L1_3, L2_3))
Bzu = multiply_matrix_vector_numba(B, z_u)
Byu = multiply_matrix_vector_numba(B, y_u)
Bzv = multiply_matrix_vector_numba(B, z_v)
Byv = multiply_matrix_vector_numba(B, y_v)
h_1 = hstack((zero3, (multiply_matrix_vector_numba(-Szu, y_e) + multiply_matrix_vector_numba(Syu, z_e)), zero6))
h_2 = hstack((Bzu, (multiply_matrix_vector_numba(-Szu, x_e) + multiply_matrix_vector_numba(Sxu, z_e)), -Bzu, zero3))
h_3 = hstack((Byu, (multiply_matrix_vector_numba(-Syu, x_e) + multiply_matrix_vector_numba(Sxu, y_e)), -Byu, zero3))
h_4 = hstack((zero9, (multiply_matrix_vector_numba(-Szv, y_e) + multiply_matrix_vector_numba(Syv, z_e))))
h_5 = hstack((Bzv, zero3, -Bzv, (multiply_matrix_vector_numba(-Szv, x_e) + multiply_matrix_vector_numba(Sxv, z_e))))
h_6 = hstack((Byv, zero3, -Byv, (multiply_matrix_vector_numba(-Syv, x_e) + multiply_matrix_vector_numba(Sxv, y_e))))
t_1 = (multiply_matrix_vector_numba(L_3, y_u) - multiply_matrix_vector_numba(L_2, z_u) + h_1) / (2 * cos(theta[0]))
t_2 = (multiply_matrix_vector_numba(L_3, x_u) + h_2) / (2 * cos(theta[2]))
t_3 = (multiply_matrix_vector_numba(L_2, x_u) + h_3) / (2 * cos(theta[4]))
t_4 = (multiply_matrix_vector_numba(L_3, y_v) - multiply_matrix_vector_numba(L_2, z_v) + h_4) / (2 * cos(theta[1]))
t_5 = (multiply_matrix_vector_numba(L_3, x_v) + h_5) / (2 * cos(theta[3]))
t_6 = (multiply_matrix_vector_numba(L_2, x_v) + h_6) / (2 * cos(theta[5]))
g = hstack((-x_e, zero3, x_e, zero3))
T = zeros((12, 7))
T[:, 0] = g
T[:, 1] = t_1
T[:, 2] = t_2
Re2_t[:, 0] = Re[:, 2]
xe_Re[0, :] = xe + Re[:, 0]
B = 1. / li[0] * (eye3 - mdotm(xe_t, xe_t.transpose()))
k = mdotm(xe_t, xe_Re)
Re1xe = vdotv(Re[:, 1], xe)
Re2xe = vdotv(Re[:, 2], xe)
L1_2 = 0.5 * Re1xe * B + mdotm(0.5 * B, mdotm(Re1_t, xe_Re))
L1_3 = 0.5 * Re2xe * B + mdotm(0.5 * B, mdotm(Re2_t, xe_Re))
L2_2 = 0.5 * Sr1 - 0.25 * Re1xe * Sr0 - mdotm(0.25 * Sr1, k)
L2_3 = 0.5 * Sr2 - 0.25 * Re2xe * Sr0 - mdotm(0.25 * Sr2, k)
L2 = vstack((L1_2, L2_2, -L1_2, L2_2))
L3 = vstack((L1_3, L2_3, -L1_3, L2_3))
Bzu = mdotv(B, zu)
Byu = mdotv(B, yu)
Bzv = mdotv(B, zv)
Byv = mdotv(B, yv)
h1 = hstack((zero3, (mdotv(-Szu, ye) + mdotv(Syu, ze)), zero6))
h2 = hstack((Bzu, (mdotv(-Szu, xe) + mdotv(Sxu, ze)), -Bzu, zero3))
h3 = hstack((Byu, (mdotv(-Syu, xe) + mdotv(Sxu, ye)), -Byu, zero3))
h4 = hstack((zero9, (mdotv(-Szv, ye) + mdotv(Syv, ze))))
h5 = hstack((Bzv, zero3, -Bzv, (mdotv(-Szv, xe) + mdotv(Sxv, ze))))
h6 = hstack((Byv, zero3, -Byv, (mdotv(-Syv, xe) + mdotv(Sxv, ye))))
T = zeros((12, 7))
T[:, 0] = hstack((-xe, zero3, xe, zero3))
T[:, 1] = (mdotv(L3, yu) - mdotv(L2, zu) + h1) / (2 * cos(theta[0]))
T[:, 2] = (mdotv(L3, xu) + h2) / (2 * cos(theta[2]))
T[:, 3] = (mdotv(L2, xu) + h3) / (2 * cos(theta[4]))