MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / canonicalAngle

Function canonicalAngle

src/compute-engine/boxed-expression/utils.ts:185–204  ·  view source on GitHub ↗
(
  x: Expression | undefined
)

Source from the content-addressed store, hash-verified

183 */
184const TRANSFORMER_HEADS = new Set([
185 'Simplify',
186 'Expand',
187 'ExpandAll',
188 'Factor',
189 'Together',
190 'Distribute',
191 'TrigExpand',
192]);
193
194/**
195 * Reduce a held (already canonical) operand whose head is an
196 * expression-transformer (see `TRANSFORMER_HEADS`) so that a structural
197 * algorithm sees the transformed expression rather than the transformer
198 * call. Any other expression is returned unchanged.
199 */
200export function reduceTransformerHead(expr: Expression): Expression {
201 return reduceTransformerHeads(inlineLambdaApplications(expr));
202}
203
204/**
205 * Reduce transformer heads anywhere in `expr`, not only at its root: in
206 * `Solve(Simplify(u) = 2, w)` the transformer sits inside the `Equal`, so a
207 * root-only check left it opaque and the solve returned `[]`.

Callers 3

powFunction · 0.90
expToTrigFunction · 0.90
applyAngleFunction · 0.90

Calls 9

numericValueFunction · 0.90
angleToRadiansFunction · 0.85
getPiTermFunction · 0.85
modMethod · 0.80
NMethod · 0.65
numberMethod · 0.65
_numericValueMethod · 0.65
mulMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected