# Matrices in Codea - a blog(ish) post

I’ve written a blog(ish) post about matrices in Codea. Having seen a fair amount of confusion about them, I thought I’d like to set things straight. There are a few subtleties about order and so forth.

You can read it at http://loopspace.mathforge.org/discussion/13/matrices-in-codea. Although the website uses a forum software, it’s not a forum. I suggest comments and discussions be here.

This was being written while certain recent conversations here about matrices were happening. These inspired various parts.

I read this article. It’s really good! It gets a bit heady in the middle, so read, take a short break, then go back to it! Great article, Andrew!

Thanks!

Which bits are “heady”? I tried to keep the maths to a minimum but it’s a bit tricky to do.

Thanks for writing this, @Andrew_Stacey! I will need to play with the examples to better understand it. I’ve used quaternions before for 3D rotations, but couldn’t say I understand them fully. Are they applicable to Codea for specifying rotations?

@Fred I use quaternions for handling rotations - I find them much easier to handle and manipulate than rotation matrices. When writing my shape explorer, I wrote a library for dealing with quaternions: http://www.math.ntnu.no/~stacey/code/CodeaLibrary/Quaternion.lua. In particular, it has a function for converting a quaternion to a matrix suitable for using in `modelMatrix()`.

I could write a follow-up post on quaternions if there’s interest.

Please do, quarternions are of interest as they seem ‘simpler’ to deal with.