{-

  Haskell - Quaternion Examples
  -----------------------------
  
  How to run : $ ghc --make examples
	       $ ./examples
  
 -}

import System.IO
import Number.Quaternion

 -- Create sample quaternions
q1 = Q 1 2 1 3
q2 = Q 2 0 0 1
q3 = q1 + q2
q4 = q3 + q2

-- Run some operations on the quaternions
q5 = q1 + q2
q6 = -q5
q7 = normalize q3
q8 = q3 * q5

len = getEuclidianLength q8

main = do
    -- Write a few quaternions to a file
    outh <- openFile "quats.txt" AppendMode
    hPrint outh q1
    hPrint outh q2
    hPrint outh q3
    hClose outh

