3 ms·
I never saw rational trigonometry, but I imagine it is mathematically overkill in another sense. When calling `sin` or `cos` in code you get back a rational app
by rocqua 4y ago
I never saw rational trigonometry, but I imagine it is mathematically overkill in another sense. When calling `sin` or `cos` in code you get back a rational approximation to the presumably irrational answer.
From what I quickly gleamed, using spreads would be really annoying to represent rotations, because you lose 'aditivity'. Two subsequent rotations with spreads a and b do not have spread `a` and spread `b`.
Lots of code using trig is about rotations, so losing that feature would probably not be the nicest.
- kragen 4y agoIn order to reason about the quality of the rational approximation, you need to reason about the irrational number it's an approximation to, for example as a Dedekind cut. Wildberger, rightly or wrongly, doesn't trust reasoning about that sort of thing; he wants to ground everything in the rationals. Maybe he's worried about finding some equivalent of Russell's barber paradox in the irrationals. Also, of course, irrational numbers don't allow you to extend trigonometric theorems to Galois fields, complex numbers, and so on, which to my mind is a much more interesting direction. I don't know how much you lose if you use Wildberger's construction into a division algebra like the quaternions. I don't actually know how you compute the "angle sum" in terms of Wildberger's spreads, but I'm pretty confident that there's a way to compute it, and it's pretty simple. In the unit-vector representation I described, angle-sum is not just simple addition, but it's really not that bad: (a + bi)(c + di) = (ac - bd) + (ad + bc)i. That's four real multiplications, an addition, and a subtraction, and the result is exact if computed in bignums or bignum rationals. This is usually cheaper than computing sine and cosine, especially if you can use SIMD or vectors, and of course if you want to rotate some points around a center, you end up having to multiply by the sin and cos in exactly the same way anyway. (Maybe in strength-reduced fashion if you're texture-mapping or something, but that applies just as well to representing the angles as sin and cos.)