diff --git a/include/fractal.hpp b/include/fractal.hpp index 601b5e6..649809a 100644 --- a/include/fractal.hpp +++ b/include/fractal.hpp @@ -6,6 +6,10 @@ #include #include #include +#include + +// TODO: Implement in MTL and create version that doesn't need cos of the angle +mtl::mat<2, 2> create_rotation(mtl::fixed angle_cos); namespace fractal { diff --git a/src/fractal.cpp b/src/fractal.cpp index f314216..6f09809 100644 --- a/src/fractal.cpp +++ b/src/fractal.cpp @@ -2,9 +2,23 @@ #include #include +#include using mtl::endl; -namespace log = mtl::log; +namespace mlog = mtl::log; + +using mtl::fixed; +using mtl::vec2; +using mtl::mat; + +mtl::mat<2, 2> create_rotation(mtl::fixed angle_cos) { + fixed angle_sin = fixed(1) - angle_cos * angle_cos; + + return mat<2, 2>({ + { angle_cos, -angle_sin }, + { angle_sin, angle_cos } + }); +} namespace fractal {