Math

Symbol Operation
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo

Using Math in Code

See the Pen Example Code by LSU DDEM ( @lsuddem) on CodePen.

https://codepen.io/lsuddem/pen/RJVMqj

See the Pen Example Code by LSU DDEM ( @lsuddem) on CodePen.

https://codepen.io/lsuddem/pen/byMorm

Math for Animation

  • fixed values for pacman

See the Pen Example Code by LSU DDEM ( @lsuddem) on CodePen.

https://codepen.io/lsuddem/pen/pKPLEx

  • updating values

See the Pen Example Code by LSU DDEM ( @lsuddem) on CodePen.

https://codepen.io/lsuddem/pen/RJVMxg

  • with erasing background:

See the Pen Example Code by LSU DDEM ( @lsuddem) on CodePen.

https://codepen.io/lsuddem/pen/gKWePW

abbreviations

Compound Symbols Operation Example
+= x = x + value x += value;
-= x = x - value x -= value;
*= x = x * value x *= value;
/= x = x / value x /= value;
%= x = x % value x %= value;

See the Pen Example Code by LSU DDEM ( @lsuddem) on CodePen.

https://codepen.io/lsuddem/pen/mKmxPR