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

Function quadrant

src/compute-engine/boxed-expression/trigonometry.ts:765–782  ·  view source on GitHub ↗
(theta: Expression)

Source from the content-addressed store, hash-verified

763 if (x.unknowns.length > 0) return undefined;
764
765 x = x.N();
766 // If the argument has an imaginary part, it's not a constructible value
767 if (x.im !== 0) return undefined;
768
769 let theta = x.re;
770 if (Number.isNaN(theta)) return undefined;
771
772 //
773 // Create the cache of special values
774 //
775 const specialValues = ce._cache<ConstructibleTrigValues>(
776 'constructible-trigonometric-values',
777 () => {
778 return CONSTRUCTIBLE_VALUES.map(([val, results]) => [
779 val,
780 Object.fromEntries(
781 Object.entries(results).map(([op, r]) => [
782 op,
783 (asLatexString(r)
784 ? ce.expr(parseLatex(asLatexString(r)!) ?? r)
785 : ce.expr(r)

Callers 1

trigSignFunction · 0.85

Calls 4

isNumberFunction · 0.90
isNaNFunction · 0.85
absMethod · 0.65
floorMethod · 0.45

Tested by

no test coverage detected