Quaternion type: Difference between revisions

Line 2,778:
=={{header|Julia}}==
This is from the [https://github.com/JuliaLang/julia/blob/master/examples/quaternion.jl quaternion example file] included with Julia 0.2, which implements a quaternion type complete with arithmetic, type conversions and promotion rules, and pretty-printing:
<lang julia>import Base: convert, promote_rule, convertshow, real, imag, conj, abs, abs2, inv, +, -, /, *
 
immutable Quaternion{T<:Real} <: Number
Anonymous user