exp method

Quaternion exp()

Computes the exponential function of this quaternion number.

Implementation

Quaternion exp() {
  final exp = w.exp();
  final norm = (x * x + y * y + z * z).sqrt();
  final scale = exp / norm * norm.sin();
  return Quaternion(exp * norm.cos(), x * scale, y * scale, z * scale);
}