diff --git a/cheatsheet.md b/cheatsheet.md index 1e855159..45ca12b1 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -1,25 +1,35 @@ ## math - -$π = radians(180.0) = acos(0.0) * 2.0$ - +``` +π = radians(180.0) = acos(0.0) * 2.0 +``` #### rule of three -$\frac{x1}{x2} = \frac{?}{y2}$ -> $? = \frac{x1 * y2}{x2}$ +``` + x1 ? x1 * y2 +---- = ---- -> ? = ------- + x2 y2 x2 + +``` ### 2d math ### trigonometry ``` - _- \ -sin(α) = a / c _- . \ -cos(α) = b / c b _- \ a -tan(α) = a / b _- \ -sin(β) = b / c _- α β \ + _-'\ +sin(α) = a / c _-' . \ +cos(α) = b / c b _-' \ a +tan(α) = a / b _-' \ +sin(β) = b / c _-' α β \ cos(β) = a / c ---------------------- tan(β) = b / a c ``` https://www.arndt-bruenner.de/mathe/scripts/dreiecksberechnungrw.htm +#### change length of a vector +``` +normalize(vec) * newLen = vec * newLen / length(vec) +``` ### 3d math +