AudioSceneDescriptionFormat / splines

Python package for creating interpolating splines (for position and rotation)
https://splines.readthedocs.io/
MIT License
61 stars 11 forks source link

The formatting of some equations... #31

Open ali1234 opened 9 months ago

ali1234 commented 9 months ago

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 commented 9 months ago

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!