示例#1
0
 def test_trans_mult(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)
     Td = Tx(d)
     Te = Ty(e)
     Tf = Tz(f)
     """
     Test
     """
     Tt = Ta * Tb * Tc
     TT = Td * Te * Tf
     TtT = Ta * Tf
示例#2
0
 def test_trans_sum(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)
     Td = Tx(d)
     Te = Ty(e)
     Tf = Tz(f)
     """
     Test
     """
     Tt = Ta + Tb - Tc
     TT = Td + Te - Tf
     TtT = Ta + Tf
示例#3
0
 def test_get_params(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)
     Tt = Ta * Tb * Tc
     """
     Test
     """
     Tt.get_params()
示例#4
0
 def test_inv(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)
     Tt = Ta * Tb * Tc
     """
     Test
     """
     Tt_inv = Tt.Inv()
     print(Tt_inv)
示例#5
0
 def test_vector_mult(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)
     Tt = Ta * Tb * Tc
     """
     Test
     """
     # Position vector in c reference frame
     r = np.array([1, 1, 1])
     # Rotated vector wrt a reference frame
     r_tr = Tt * r
     # Sum of rotated vector (still a symbolic transform instance) and other vector
     r_rtr = r_tr + r
示例#6
0
 def test_latex(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)
     Tt = Ta * Tb * Tc
     # Position vector in c reference frame
     r = np.array([1, 1, 1])
     # Rotated vector wrt a reference frame
     r_tr = Tt * r
     """
     Test
     """
     # Rotated vector: LaTeX output
     r_tr.to_latex()
示例#7
0
 def test_lambd(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)
     Tt = Ta * Tb * Tc
     # Position vector in c reference frame
     r = np.array([1, 1, 1])
     # Rotated vector wrt a reference frame
     r_tr = Tt * r
     """
     Test
     """
     # Get lambda function of rotated vector
     f = r_tr.get_lambda()
     # Rotated vector wrt a reference frame, by angles alpha, beta and gamma
     r_tr.suppress = False
     r_tr_num = r_tr(0.2, 0.3, np.pi / 2)
示例#8
0
import numpy as np
import sympy as sp

from transforms import Tx, Ty, Tz

# Variables
a = sp.Symbol("alpha")
b = sp.Symbol("beta")
c = sp.Symbol("gamma")

# Transforms
Ta = Tx(a)
Tb = Ty(b)
Tc = Tz(c)
Tt = Ta * Tb * Tc
TT = Ta + Tb + Tc

# Position vector in c reference frame
r = np.array([1, 1, 1])

# Rotated vector wrt a reference frame
r_tr = Tt * r

# Lambdify
r_tr_num = r_tr(0.2, 0.3, np.pi / 2)

# To LaTeX
r_tr.to_latex()
示例#9
0
 def test_init_n(self):
     Td = Tx(d)
     Te = Ty(e)
     Tf = Tz(f)
示例#10
0
 def test_init_s(self):
     Ta = Tx(a)
     Tb = Ty(b)
     Tc = Tz(c)