Sylvain LC's Blog

A GitHub blog, usefull to me, hope the same for you.

Avoid trigonometry and save a kitten

These articles of IQ about using vectors operations (dot and cross products) instead of trigonometry functions interested me.
Developers are not always motivated to make high-performance code. But if it’s about saving kittens to be murdered, maybe they’ll make the effort?

cat

This kitten is my neighbour’s. And he’s not dead fortunately, but he sleeps peacefully while I leave for work.

This first article tells about using the dot product instead of cos and cross product instead of sin.

Inigo Quilez :: articles :: avoiding trigonometry - 2013

This second one makes you have a good use of the formulas below for optimization.

sin(α + β)=sin(α) * cos(β) + cos(α) * sin(β)
cos(α + β)=cos(α) * cos(β) - sin(α) * sin(β)

Inigo Quilez :: articles :: a sin/cos trick - 2010