Algebraic calculation of the rainbow by Spinoza