If you have a lot of them, is it possible you might be better off doing diagonal lines? If you look at my example, both squares and triangles have the same measure on the diagonal. If your mat has a diagonal line, measure the regular width you want, then measure the diagonal for that width, and don't bother with any math at all.
Of course, if your calculator does square roots (advanced calculator on Windows) A squared + B squared (finished sizes of sides) = C squared (the diagonal), then find the square root and add seam allowances.
Even though I am a former math teacher, I just use my mat and ruler. It's faster.