| 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) |