Skip to content

Typeset powers of trig functions#829

Merged
StevenClontz merged 6 commits intomainfrom
DrewLewis/precalc-trig-typesetting
Jul 23, 2025
Merged

Typeset powers of trig functions#829
StevenClontz merged 6 commits intomainfrom
DrewLewis/precalc-trig-typesetting

Conversation

@siwelwerd
Copy link
Copy Markdown
Contributor

This relies on #684 , but closes #826

@github-actions
Copy link
Copy Markdown

🚀 Preview available 🚀

https://8d05ab89.tbil.pages.dev

@siwelwerd siwelwerd requested a review from StevenClontz June 24, 2025 18:01
Comment on lines +475 to +476
def typeset_trigpowers(f):
return f.substitute_function(sin(x)==TBIL.sinp(x,1)).substitute_function(cos(x)==TBIL.cosp(x,1)).substitute_function(tan(x)==TBIL.tanp(x,1)).substitute_function(sec(x)==TBIL.secp(x,1)).substitute_function(csc(x)==TBIL.cscp(x,1))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using TBIL.sinp,etc. directly, this allows users to do whatever they want with built in trig functions, and then right before displaying call this on the expression they want to typeset. So users should hopefully never need the TBIL.sinp functions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the solution + implementation, but I'm hanging on the naming of variables a bit. E.g. I'd expect TBIL.typeset_trigpowers to return a string or LatexExpr. Since I think you have another PR depending on this, I'll do the renaming in a separate PR.

@siwelwerd
Copy link
Copy Markdown
Contributor Author

@tdegeorge Can you take a look at the Checkit previews here and double check that they look okay? I think everything should be typeset as desired now.

@github-actions
Copy link
Copy Markdown

🚀 Preview available 🚀

https://eb9ee7b6.tbil.pages.dev

@tdegeorge
Copy link
Copy Markdown
Contributor

It looks like it worked! :)

@StevenClontz StevenClontz merged commit 1c7348b into main Jul 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

checkit Involves randomized exercise banks precalculus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typesetting powers of sine

3 participants