| 38 | Doing Math with Eyeglass |
Creating shapes, perfecting animations, or making canvases can all require some complex mathematical functions. Sass includes some basic operators, but for more in-depth functionality, you should turn to the eyeglass-math module.
Once you’ve installed the module using the command in the example, you need to use @import "math"; in your style sheet to include all the math functions.
In the first example, the $PI variable and the sqrt() function are used to calculate the diameter of a circle. This could be useful for generating CSS circles with areas that are tied to specific values.
You can calculate heights and widths of triangles using trigonometric functions. eyeglass-math comes with all the major trigonometry ...