def norm_array(q):
        """
        Calculate quaternion norm on array q
        :param quaternion: array of len 4
        :returns: norm (scalar)
        """
        assert(len(q) == 4)
        return np.sqrt(np.dot(q, q))
Calculate quaternion norm on array q
        :param quaternion: array of len 4
        :returns: norm (scalar)