Rotate 3D vector v by this quaternion Args: ``v`` (``numpy.ndarray``): Must be 1D vector. Returns: The rotated vector.
(self, v)
| 158 | ]) |
| 159 | |
| 160 | def rotate(self, v): |
| 161 | """ Rotate 3D vector v by this quaternion |
| 162 | |
| 163 | Args: |
| 164 | ``v`` (``numpy.ndarray``): Must be 1D vector. |
| 165 | |
| 166 | Returns: |
| 167 | The rotated vector. |
| 168 | """ |
| 169 | m = norm(v) |
| 170 | v = Quaternion([0, v[0], v[1], v[2]]) |
| 171 | r = self * v * self.conjugate() |
| 172 | return r[1:4] * m |
| 173 | |
| 174 | @property |
| 175 | def w(self): |
nothing calls this directly
no test coverage detected