Wedgie: Difference between revisions
Note the first entry should be positive |
→Derivation from mapping matrices: + Python script |
||
(2 intermediate revisions by one other user not shown) | |||
Line 70: | Line 70: | ||
== Derivation from mapping matrices == | == Derivation from mapping matrices == | ||
{{Todo|inline=1| expand }} | {{Todo|inline=1| expand }} | ||
Below is a script that finds the wedgie from a mapping matrix in [https://www.python.org/ Python], using [https://scipy.org/ Scipy]. | |||
<syntaxhighlight lang="python"> | |||
import itertools | |||
import numpy as np | |||
from scipy import linalg | |||
def wedgie (breeds): | |||
combinations = itertools.combinations (range (breeds.shape[1]), breeds.shape[0]) | |||
wedgie = np.array ([linalg.det (breeds[:, entry]) for entry in combinations]) | |||
if wedgie[0] < 0: | |||
wedgie *= -1 | |||
# convert to integer type if possible | |||
wedgie_rd = np.rint (wedgie) | |||
if np.allclose (wedgie, wedgie_rd, rtol = 0, atol = 1e-6): | |||
wedgie = wedgie_rd.astype (int) | |||
return wedgie | |||
</syntaxhighlight> | |||
== Derivation from edo joins == | == Derivation from edo joins == | ||
{{See also| | {{See also|Wedge product }} | ||
[[File:Wedgediagram .png|thumb|504x504px|Wedge product diagram]] | |||
Two [[vals]] can be combined into a wedgie representing the rank-2 temperament they both support using the wedge product. For example, wedging {{val| 5 8 12 }} and {{val| 7 11 16 }} (the patent vals for 5edo and 7edo) yields {{multival| (5×11 - 8×7) (5×16 - 12×7) (8×16 - 12×11) }}, which simplifies to {{multival| (55 - 56) (80 - 84) (128 - 132) }} and thus to {{multival| -1 -4 -4 }}. Note that we generally assume the first entry of the wedgie should be positive, for which we flip all the signs of it to obtain {{multival| 1 4 4 }}, which is the wedgie for 5 & 7, a.k.a. meantone. | Two [[vals]] can be combined into a wedgie representing the rank-2 temperament they both support using the wedge product. For example, wedging {{val| 5 8 12 }} and {{val| 7 11 16 }} (the patent vals for 5edo and 7edo) yields {{multival| (5×11 - 8×7) (5×16 - 12×7) (8×16 - 12×11) }}, which simplifies to {{multival| (55 - 56) (80 - 84) (128 - 132) }} and thus to {{multival| -1 -4 -4 }}. Note that we generally assume the first entry of the wedgie should be positive, for which we flip all the signs of it to obtain {{multival| 1 4 4 }}, which is the wedgie for 5 & 7, a.k.a. meantone. | ||