AngouriMath

Navigation

← Back to list of members

PythagoreanIdentity

 Property

Summary

The Pythagorean identity, written once and firing wherever the two terms sit.

Remarks

This set exists to show what Gathered``1(System.String,AngouriMath.Core.Transformations.Matching.MatchPattern[]) buys, because the
switch cannot express it. Patterns.TrigonometricRules spends two arms on this identity — Sumf(Powf(Sinf, 2), Powf(Cosf, 2)) and the same with the
operands the other way round — because it has no commutative matching, and both match
only two children of one Sumf. So the pair is found in
sin(x)^2 + cos(x)^2 and missed in a + sin(x)^2 + b + cos(x)^2, where the
two terms are not siblings. The library's answer is to sort the operands with
CanonicalOrder before the rules run, so the pair becomes adjacent. That works,
and it is the matcher's limitation showing through as a pipeline stage.
Here the rule says what it means: among the terms of this sum, find one squared
sine and one squared cosine of the same argument
. The rest of the sum comes back
bound, and is 0 when there is none, so the same rule covers both shapes.
Sound: sin²+cos² = 1 holds for every complex argument,
with no branch to choose and no point excluded.
The one rule here with no backwards reading, and the reason is the identity
rather than the way it is written: 1 does not say which angle it came from, so
x is bound on the left and mentioned nowhere on the right.
Reversal is ReplacementDropsHoles and Reversed is null.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online