Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The formatting of some equations... #31

Open
ali1234 opened this issue Feb 15, 2024 · 1 comment
Open

The formatting of some equations... #31

ali1234 opened this issue Feb 15, 2024 · 1 comment

Comments

@ali1234
Copy link

ali1234 commented Feb 15, 2024

Regarding section "Non-Uniform Cubic Hermite Splines", section 8, where you derive the derivative.

image

Why does the 2 get distributed inside the brackets here? Wouldn't it be better written 2C4(t - t4)? This would be easier to relate back to the derivative of the uniform spline. I realise this is probably a quirk of sympy, but it had me confused for a while.

@mgeier
Copy link
Member

mgeier commented Feb 20, 2024

I realise this is probably a quirk of sympy

Yeah, I guess so.
I asked at the SymPy mailing list, see the answer there: https://groups.google.com/g/sympy/c/ObH0PioYO8w/m/lq2EObrMAQAJ

I tried using simplify() (and factor_terms(), as suggested in the answer), which pulls out the "2", but it also puts the whole expression on a common denominator, which I also didn't really like.

Anyway, I often don't like the exact way SymPy formats the equations, but I do like the fact that they are automatically derived.
In some cases, for what I considered important equations, I re-wrote them again manually, to have the terms formatted in a specific way. But then there is always the possibility of a typo creeping in ...


Long story short, if somebody knows a way to improve the display of this equation (or others), please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants