Open olekscode opened 3 years ago
I am noticing now that the Complex Number Test Class has a large number of methods. A refactor might split this up, and there are a number of ways to do that (I'll provide a list in a moment...).
Because quaternions also have a conjugate operation, will you need yet another quaternionConjugate
selector?
I referred to Wikipedia, and the word used there is conjugation:
Conjugation of quaternions is analogous to conjugation of complex numbers and to transposition (also known as reversal) of elements of Clifford algebras. To define it, let {\displaystyle q=a+b\,\mathbf {i} +c\,\mathbf {j} +d\,\mathbf {k} } be a quaternion. The conjugate of q is the quaternion {\displaystyle q^{*}=a-b\,\mathbf {i} -c\,\mathbf {j} -d\,\mathbf {k} }. It is denoted by q∗, qt, {\displaystyle {\tilde {q}}}, or q.[7] Conjugation is an involution, meaning that it is its own inverse, so conjugating an element twice returns the original element. The conjugate of a product of two quaternions is the product of the conjugates in the reverse order. That is, if p and q are quaternions, then (pq)∗ = q∗p∗, not p∗q∗.
The conjugation of a quaternion, in stark contrast to the complex setting, can be expressed with multiplication and addition of quaternions:
{\displaystyle q^{*}=-{\frac {1}{2}}(q+\,\mathbf {i} \,q\,\mathbf {i} +\,\mathbf {j} \,q\,\mathbf {j} +\,\mathbf {k} \,q\,\mathbf {k} )~.}
Are we discovering that conjugate may have meanings in different contexts? I.e. bounded contexts.
Because numbers can also be conjugate in a different sense:
5 + 5 sqrt
is conjugate to5 - 5 sqrt
. https://math.stackexchange.com/questions/3397053/whats-the-correct-definition-of-conjugate-and-do-we-identify-themAlso, this message should be implemented by
Number
And testing: