Tuesday, January 10, 2017

Simple rotation matrix in Libreoffice Calc

Just for fun, I thought I'd see how the matrix multiplication works in Libreoffice.

So we have a little set of XY points in a1:b5 to draw a triangular shape.

Put the rotation angle in c1 and convert that to radians in d1.

A rotation matrix in e1:f2 that is transposed from the wikipedia form as it gets multipled rows by columns.

and put a matrix forula with CTRL+SHIFT+ENTER in g1:h5.

Insert a chart with a two data ranges, graphing a1:b5 and g1:h5. It looks best if you set the axes from -20 to 20.










LibreOffice calc redraws the graph on the fly so you get an animation with this:




No comments:

Post a Comment