n-dimensional ln and exp functions

84 Views Asked by At

I have some quaternion functions, like ln and exp. If I want to go to 5-component numbers, I can easily migrate the ln and exp functions by adding in an extra imaginary component. Since 5-component numbers do not have a multiplication operator defined, why not just do exp(ln(Q1) + ln(Q2)) instead of the missing Q1*Q2 functionality?

I tried it out with the quaternion Julia set, and it sort of works. Attached is a figure of the standard Julia set, Z = Z^2 + C.

Why is there no multiplication operator in 5D anyway?

enter image description here

The exp function is:

float mag_vector = std::sqrt(qA->y * qA->y + qA->z * qA->z + qA->w * qA->w);

temp_a_x = qA->x;

qOut->x = std::exp(temp_a_x) * std::cos(mag_vector);

qOut->y = std::exp(temp_a_x) * std::sin(mag_vector) * qA->y / mag_vector;

qOut->z = std::exp(temp_a_x) * std::sin(mag_vector) * qA->z / mag_vector;

qOut->w = std::exp(temp_a_x) * std::sin(mag_vector) * qA->w / mag_vector;

To add in a 5th-component, one would have to just alter mag_vector to include it, and then change qA->whatever to qA->a where a is the 5th component.