'How can I apply the definitions by using a quaternion (1, 2, 3, 4)?

import numpy as np

def q(q):
    q = (w, x, y, z)

def qconj(qc):
    qc = q*(1, -1, -1, -1)

def qnor(qn):
    qn = q**2

def qinv(qi):
    qi = qc/qn

w = 1
x = 2
y = 3
z = 4

print(qi)

Hi. I'm new to Python. I want to apply the quaternion (1, 2, 3, 4) to the definition I just use and obtain qi, which is q_inverse (q^-1). It doesn't seem to work and I don't know why.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source