def R_y(self): theta = self.theta q = self.q israd = self.israd theta = theta if israd else radian(theta) theta = theta / 2 return np.array([[ q_cos(u=theta, q=q, israd=israd), q_sin(u=theta, q=q, israd=israd) * -1 ], [q_sin(theta, q=q, israd=israd), q_cos(u=theta, q=q, israd=israd)]]).real
def q_psi(theta, gamma, q=1, israd=True): import numpy as np gamma = radian(gamma) if (not israd) else gamma theta = radian(theta) if (not israd) else theta theta = 1j * theta / 2 gamma = gamma / 2 gamma[gamma <= np.pi] = np.nan theta[theta <= 2 * np.pi] = np.nan coluna0 = [q_exp(-theta, q).real * q_cos(gamma, q).real] coluna1 = [q_exp(theta, q).real * q_sin(gamma, q).real] return array([coluna0, coluna1])
def q_psi(theta, gamma, q=1, israd=True): import numpy as np gamma = radian(gamma) if (not israd) else gamma theta = radian(theta) if (not israd) else theta theta = 1j * theta / 2 gamma = gamma / 2 #print(gamma) #gamma = np.array(gamma) if (type(gamma) == np.ndarray): gamma[np.abs(gamma) > np.pi] = np.nan theta[np.abs(theta) > 2 * np.pi] = np.nan else: gamma = np.nan if np.abs(gamma) > np.pi else gamma theta = np.nan if np.abs(theta) > 2 * np.pi else theta coluna0 = [q_exp(-theta, q).real * q_cos(gamma, q).real] coluna1 = [q_exp(theta, q).real * q_sin(gamma, q).real] return array([coluna0, coluna1])