Sun Tzŭ multiplication & division animations (Mathematica)

See <https://github.com/yawnoc/sun-tzu-arithmetic>, which consists of crappy Mathematica code for the animations in my translation of Sun Tzŭ's Computational Classic, in particular Vol. I §8§13 (multiplcation) and §9§14 (division).

  1. Change to the directory of SunTzu.wl.
  2. Load the package by running << SunTzu`.
  3. Run the following:

Multiplication

{
  {81, 81},
  {1989, 64},
  {1024, 1024},
  {246, 97531}
} /.
  {x_, y_} :> MultiplyAnimation[x, y, Export -> True]
81 \times 81 = 6561 1989 \times 64 = 127296 1024 \times 1024 = 1048576 246 \times 97531 = 23992626
Animation for Sun Tzŭ multiplication: 81 multiplied by 81 Animation for Sun Tzŭ multiplication: 1989 multiplied by 64 Animation for Sun Tzŭ multiplication: 1024 multiplied by 1024 Animation for Sun Tzŭ multiplication: 246 multiplied by 97531

Division

{
  {100, 6},
  {1989, 64},
  {6561, 9},
  {97531, 4}
} /.
  {x_, y_} :> DivideAnimation[x, y, Export -> True]
100 \div 6 = 16 + \dfrac{4}{6} 1989 \div 64 = 31 + \dfrac{5}{64} 6561 \div 9 = 729 97531 \div 4 = 24382 + \dfrac{3}{4}
Animation for Sun Tzŭ division: 100 divided by 6 Animation for Sun Tzŭ division: 1989 divided by 64 Animation for Sun Tzŭ division: 6561 divided by 9 Animation for Sun Tzŭ division: 97531 divided by 4