Setting Brackets
Objects of the same class are mathematical groups
with respect to addition and thus allow arbitrary setting of brackets.
I.e. the following is always true if a, b and c are all points,
rectangles, quads or matrices:
a ± b ± c == (a ± b) ± c == a ± (b ± c)
The set of Matrix
objects, with its additional multiplication, is a mathematical ring, which has the (left and right) distributive property:
(m1 ± m2) * m3 == m1 * m3 ± m2 * m3
m1 * (m2 ± m3) == m1 * m2 ± m1 * m3
Care must taken when setting brackets across different geometry classes! If r, r1, r2 are rectangles, λ, λ1, λ2 are numbers and m, m1, m2 are matrices, we have the following:
This is true:
(r1 ± r2) * λ == r1 * λ ± r2 * λ
But (*):
(r1 ± r2) * m ≠ r1 * m ± r2 * m
This is true:
r * m1 * m2 == (r * m1) * m2
r * λ1 * λ2 == (r * λ1) * λ2 == r * (λ1 * λ2)
But (*):
r * m1 * m2 ≠ r * (m1 * m2)