Exemple #1
0
	void Quaternion::operator*=(const Quaternion& other)
	{
		real oldR = m_R;
		real oldI = m_I;
		real oldJ = m_J;
		real oldK = m_K;
		m_R = (oldR*other.GetR()) - (oldI*other.GetI()) - (oldJ*other.GetJ()) - (oldK*other.GetK());
		m_I = (oldR*other.GetI()) + (oldI*other.GetR()) + (oldJ*other.GetK()) - (oldK*other.GetJ());
		m_J = (oldR*other.GetJ()) + (oldJ*other.GetR()) + (oldK*other.GetI()) - (oldI*other.GetK());
		m_K = (oldR*other.GetK()) + (oldK*other.GetR()) + (oldI*other.GetJ()) - (oldJ*other.GetI());
	}