Anonymous user
Quaternion type: Difference between revisions
→{{header|Red}}
(Added example of Red language) |
|||
Line 5,780:
=={{header|Red}}==
<lang Red>
quaternion!: make typeset! [block! hash! vector!]
multiply: function [q [integer! float! quaternion!] p [integer! float! quaternion!]][
Line 5,814:
print [{
1. The norm of a quaternion:
`
2. The negative of a quaternion:
`
3. The conjugate of a quaternion:
<code>
4. Addition of a real number `r` and a quaternion `q`:
`
`
5. Addition of two quaternions:
`
6. Multiplication of a real number and a quaternion:
`
`
7. Multiplication of two quaternions `q1` and `q2` is given by:
`
8. Show that, for the two quaternions `q1` and `q2`:
`equal?
</lang>
|