startracker.py
def q2a(q):
    """Quarternion converted to an attitude array."""
    q = q / np.linalg.norm(q)
    retval = np.array(
        [[
            q[0] ** 2 - q[1] ** 2 - q[2] ** 2 + q[3] ** 2,
            2 * (q[0] * q[1] + q[2] * q[3]),
            2 * (q[0] * q[2] - q[1] * q[3])],
            [
                2 * (q[0] * q[1] - q[2] * q[3]),
                - q[0] ** 2 + q[1] ** 2 - q[2] ** 2 + q[3] ** 2,
                2 * (q[1] * q[2] + q[0] * q[3])],
            [
                2 * (q[0] * q[2] + q[1] * q[3]),
                2 * (q[1] * q[2] - q[0] * q[3]),
                - q[0] ** 2 - q[1] ** 2 + q[2] ** 2 + q[3] ** 2]])
    return retval
Quarternion converted to an attitude array.
Quarternion converted to an attitude array.
Quarternion converted to an attitude array .
def q2a(q):
    q = q / np.linalg.norm(q)
    retval = np.array(
        [[
            q[0] ** 2 - q[1] ** 2 - q[2] ** 2 + q[3] ** 2,
            2 * (q[0] * q[1] + q[2] * q[3]),
            2 * (q[0] * q[2] - q[1] * q[3])],
            [
                2 * (q[0] * q[1] - q[2] * q[3]),
                - q[0] ** 2 + q[1] ** 2 - q[2] ** 2 + q[3] ** 2,
                2 * (q[1] * q[2] + q[0] * q[3])],
            [
                2 * (q[0] * q[2] + q[1] * q[3]),
                2 * (q[1] * q[2] - q[0] * q[3]),
                - q[0] ** 2 - q[1] ** 2 + q[2] ** 2 + q[3] ** 2]])
    return retval
def q2a ( q ) : q = q / np . linalg . norm ( q ) retval = np . array ( [ [ q [ 0 ] ** 2 - q [ 1 ] ** 2 - q [ 2 ] ** 2 + q [ 3 ] ** 2 , 2 * ( q [ 0 ] * q [ 1 ] + q [ 2 ] * q [ 3 ] ) , 2 * ( q [ 0 ] * q [ 2 ] - q [ 1 ] * q [ 3 ] ) ] , [ 2 * ( q [ 0 ] * q [ 1 ] - q [ 2 ] * q [ 3 ] ) , - q [ 0 ] ** 2 + q [ 1 ] ** 2 - q [ 2 ] ** 2 + q [ 3 ] ** 2 , 2 * ( q [ 1 ] * q [ 2 ] + q [ 0 ] * q [ 3 ] ) ] , [ 2 * ( q [ 0 ] * q [ 2 ] + q [ 1 ] * q [ 3 ] ) , 2 * ( q [ 1 ] * q [ 2 ] - q [ 0 ] * q [ 3 ] ) , - q [ 0 ] ** 2 - q [ 1 ] ** 2 + q [ 2 ] ** 2 + q [ 3 ] ** 2 ] ] ) return retval
Quarternion converted to an attitude array.
Quarternion converted to an attitude array .
"""Quarternion converted to an attitude array."""
q