Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Rational Trigonometry (stijnoomes.com)
95 points by KqAmJQ7 on Jan 9, 2023 | hide | past | favorite | 43 comments


Also, John Cook recently blogged about it at https://www.johndcook.com/blog/2023/01/06/rational-trigonome... and wrote:

> I became interested in rational trigonometry when I was working on a project to formally verify drone collision avoidance software. Because all calculations are purely algebraic, involving no transcendental functions, theorems are easier to prove. ...

> Another advantage is accuracy. Because a computer can carry out rational arithmetic exactly, rational trigonometry applied to rational points yields exact results. No need to be concerned about the complications of floating point numbers.

> A less obvious advantage is that the theory of rational trigonometry is independent of the underlying field


> Because all calculations are purely algebraic, involving no transcendental functions, theorems are easier to prove. ...

Personally I would have said manipulation of trig identities and such is also purely algebraic.


They meant algebraic in the sense of https://en.wikipedia.org/wiki/Algebraic_operation.


Sure, but to be honest I'm a little bit boggled at the idea of a phd mathematician finding trig manipulation hard enough to be worth commenting on.


This review of Wildberger's book at https://philarchive.org/archive/FRADPR says the point isn't that the PhD mathematician finds trig hard, but rather to beginners:

> ... very becoming-numerate generation invests enormous effort in the painful calculation of the lengths and angles of complicated figures. Surveying, navigation and computer graphics are intensive users of the results. Much of that effort is wasted, Wildberger argues. The concentration on angles, especially, is a result of the historical accident that serious study of the subject began with spherical trigonometry for astronomy and long-range navigation, which meant there was altogether too much attention given to circles. ...

> Having things done better is one major payoff, but equally important would be a removal of a substantial blockage to the education of young mathematicians, the waterless badlands of traditional trigonometry that youth eager to reach the delights of higher mathematics must spend painful years crossing

Whether that's correct is different. https://handwiki.org/wiki/Rational_trigonometry seems to give a good description of opposing views.


I don't have a particularly high opinion of John D. Cook but I still wouldn't call him a 'beginner'.


I apologize. I misread the context of the thread. I mistakenly though you were commenting on Wildberger's reasoning for promoting rational trigonometry, rather than on Cook's decision to use that approach.

If "formal verification" involves using a software-based proof assistant or automatic theorem prover then perhaps that easier to encode for those tools via rational trigonometry?

Why not ask him directly?


Cook isn't proving results about trig functions/identities; they're proving results about software. Software can never correctly implement trig functions; it must always approximate, and that is the reason it's hard to verify.

In contrast, arithmetic on rational numbers can be implemented exactly; at least, up to the memory limits of the machine (e.g. using pair of bignums for numerator/denominator)


>A less obvious advantage is that the theory of rational trigonometry is independent of the underlying field

What sort of interesting results come out of using a non-real field here?


You'll need to ask an actual mathematician. Cook recently wrote that blog post, so it's much better to ask him in the comment section of that post.

Just because I can do a Google Scholar query using "rational trigonometry" and find papers saying things like:

"Explicit tough Ramsey graphs" at https://arxiv.org/pdf/0807.2692.pdf . "We present here two new explicit constructions ... The first construction is based on a remarkable new approach of Wildberger to trigonometry and Euclidean geometry."

does not mean I am qualified to judge what is "interesting", or figure out which use non-real fields.


> I promise that rational trigonometry will pay off in a big way later.

Sorry, I seem to have missed that part. The article just ends suddenly. It's an interesting idea, but what's the benefit?


I am developing a novel theory on 3D vision. Rational trigonometry allows me to derive rather simple expressions. Here is an example:

https://stijnoomes.com/height-of-the-center-of-projection/


The article, and the other ones linked here, are too short, indeed. As if the idea gets dusted off, proudly presented, and then forgotten because it's just not practical enough. This wikipedia page also falls short of a conclusion: https://en.wikipedia.org/wiki/Divine_Proportions:_Rational_T...

E.g., one thing that seems not very compatible is complex numbers: I can't see how e^(i*alpha) would benefit.

So ... it's a specialized tool?


This works perfectly fine with complex numbers. Consider Gaussian integers or Gaussian rationals (complex numbers of the form a + b i, where a and b are integers or rationals). Like complex numbers in general, these amount to the combination of scaling by some magnitude and rotating by some angle. If we only care about the angle, we can consider two Gaussian rationals to be equivalent if their ratio is a positive real number.

Any angle with a rational tangent or cotangent has some representation as a Gaussian rational (usually requiring a non-unit magnitude, though), and these angles are closed under addition and subtraction (corresponding to multiplying and dividing these Gaussian rationals). And given a Gaussian integer or rational, we can readily take its squared magnitude (a^2 + b^2) to get an integer or rational, and we can in the same way take the squared cosine or squared sine of its angle (a^2/(a^2 + b^2) or b^2/(a^2 + b^2)) to get a rational.


I don't see how that would help: e^(i*√s) is only further analyzable when s is the square of a rational number, but even then it won't help you go further: e^i*k is not rational (k≠0). In something like DFT or FIR analysis, it wouldn't help to work with spread instead of angle, I think. Integrating over s^2 only adds more steps, and I also don't see how it could help numerical approximation.


Wildberger's take (e.g. https://www.youtube.com/watch?v=by0Gy1ZJ_hU ) is that rational trigonometry is well-suited to 'triangle geometry' (i.e. anywhere we might use Pythagoras); whilst angles are well-suited to uniform circular motion (although even there he prefers turns instead of radians ;) https://www.youtube.com/watch?v=CnQXRdgN_7I ).


I am not a mathematician but I follow one on the internet. Quoting https://www.johndcook.com/blog/2023/01/06/rational-trigonome...

> You can work over the rational numbers, but you don’t need to. You could work over real or complex numbers, or even finite fields. Because you don’t take square roots, you can work over fields that don’t necessarily have square roots. If you’re working with integers modulo a prime, half of your numbers have no square root and the other half have two square roots. ...

> Why would you want to do geometry over finite fields? Finite fields are important in applications: error-correcting codes, cryptography, signal processing, combinatorics, etc. And by thinking of problems involving finite fields as geometry problems, you can carry your highly developed intuition for plane geometry into a less familiar setting.

"Orientation Modeling Using Quaternions and Rational Trigonometry" at https://www.mdpi.com/2075-1702/10/9/749 has an example of using it with complex numbers:

  We can define the quadrance of z by:
    Q(z) = z · z̅ = a² + b². 

  Spread: The spread can be defined in several ways ...
  in a more general way, the spread can be specified
  for any complex number by the next expression:
    s(w) ≡ b² / a²
The paper includes the section "Rotations on the Plane" which may address your e^(i*alpha).


e^{it} would get replaced with \frac{1+it}{1-it}. t=n/d then implies \frac{1+it}{1-it}=\frac{d+in}{d-in}.

RT boils down to doing trigonometry with dot products and without square roots. There's a temptation to replace dot products with ordinary trigonometry, but RT says don't do it because it's a step back.


N. J. Wildberger is a real mathematician but beware that he's somewhat idiosyncratic and a bit of a ultra-finitist.

https://www.youtube.com/@njwildberger

His Trig series:

https://www.youtube.com/watch?v=GGj399xIssQ&list=PL3C5849871...


I like is idiosyncratic take on math, it is good to know there is someone with a slightly different opinion than everyone else.

His videos about multisets released in the last weeks have been super interesting. They seem like a very promising alternative to classical set theory that maybe could be used for some better type system.


I made a public bet with Norman in early 2020 (late Feb) about whether the university we were at would hold classes until the end of the term (he believed they would not due to covid). Norman was the only one with the guts to publicly point out the obvious (anybody with the Wikipedia page for China case numbers and a spreadsheet could have figured out what was going to happen in late Feb). Among other things he was a great lecturer and a talented go player, although I never really thought that rational trig was worth all the effort - regular math seems to have plenty of utility even if you think it is built on shaky philosophical foundations.


> I never really thought that rational trig was worth all the effort - regular math seems to have plenty of utility even if you think it is built on shaky philosophical foundations

For those familiar with "normal" (irrational?) trig, it's certainly an extra effort to learn, and may hinder communication, which gives a poor cost/benefit ratio.

For those unfamiliar with "normal" trig (e.g. not reaching that stage in school, or having later forgot it all), then rational trig certainly seems easier to learn and understand. I also like the way it generalises, e.g. to hyperbolic space (relativity), by simply changing the dot-product.


Part of the utility of rational trig seems to be that it can work in any field, while functions like sin and cos only work for reals. I.e. you can use rational trig describe the "geometry" of a "triangle" whose points have coordinates in a finite field


> Norman was the only one with the guts to publicly point out...

Sorry; what context was this in? UNSW maths department or some other social circle? I know I was anticipating lockdowns some time around then for exactly the same reasons as you list, but I assumed that all the mathematicians would have figured it out around the same moment.


Yes UNSW maths. Maybe everybody else had it figured out, but certainly Norman was the first to publicly acknowledge that all the learning would have to be online within a few months.


In my CS department this was anticipated by a few of us, pretty universally so by the end of February.


> even if you think it is built on shaky philosophical foundations.

What does this mean? What shaky philosophical foundations?


NJW posits that Real Numbers and Set Theory are based on the notion that it is possible to do an infinite number of calculations which he considers disingenuous.

He highlights in some of his Youtube videos that in respected Math textbooks the definition of real numbers is left vauge.

In his opinion set theory has the same kind of holes the we are expected to accept that we can add an infinite quantity of things to a Set by describing a function or simply having a desciption of the elements of the Set.


Within ZFC there are precise models of the real numbers and it’s not at all vague or on a loose footing.


https://www.youtube.com/watch?v=jlnBo3APRlU

The gist of the argument is that addition + other operations on non-computable numbers (which the real numbers contain) require infinite algorithms or something similar (unlike addition on computable irrational numbers which may require infinite work, but the algorithms are finite). You can therefore get situations where, say, the tenths digit in a sum of non-computable numbers is not defined because of potentially infinite carries, and there's no way to determine if the sequence of carries terminates or not. He discusses the problem in the context of different representations of real numbers, including infinite decimals, cauchy sequences, and dedekind cuts etc. This is just the gist of it.


This is different than saying the definition of the reals is “vague”. The models and various definitions are not vague. They are as precise as the axioms of Euclidean geometry or any other axiomatic system. His objections are reasons why he doesn’t like the axioms. One can either accept or reject the axiomatic system but it isn’t vague.


Maybe not "vague", but "underspecified".

ZFC models the set of real numbers, but only provides a model for a measure-zero amount of specific individual real numbers. It just says "yeah they exist".

People like Wildberger believe that anything that exists in math should have some way of determining its exact value, otherwise, what is "it"?


That I understand. I objected to the idea that the theory was vague rather than that the theory contains objects that are vague. Even so, if one thinks the theory contains vague objects then we run into considerations such as the following:

https://mathoverflow.net/questions/44102/is-the-analysis-as-...

I suppose being a finitist allows one the get around what Hankins wrote.


Wildberger is an ultrafinitist


Related:

Show HN: Simple pendulum simulation with rational trigonometry - https://news.ycombinator.com/item?id=12525068 - Sept 2016 (28 comments)


I'm not sure this is any more useful than just linear algebra with an inner product.


It works well with linear algebra, if you want to do that. If you don't, then there's no need to mess around with matrices, etc.


There isn't really any need to deal with matrices for just geometry. The ability to use matrices however is a great tool. For one I don't know of a more elegant expression for the area of a triangle than just

    |P Q R|
    |1 1 1| / 2
Rational trigonometry seems to me like it's just linear algebra, except it uses the squared sine instead of the cosine just to get a notion of angle that is 0 for parallel line. Lot's of linear algebra features are removed, but I'm not seeing much benefit from doing so.


The same formula appears in rational trig, e.g. in section 9.3 of Divine Proportions http://www.ms.lt/derlius/WildbergerDivineProportions.pdf#pag...


It slightly obscures the simplicity of spread to define it in terms of angles and transcendental functions. It can instead be defined directly, as opposite/hypotenuse on a right-angled triangle.

Likewise, we can take quadrance as primary; and, if we're so inclined, we can define distance as its square root.


I'm reminded of Chebyshev polynomials, which do a similar kind of thing, and I'd bet that polynomials in Wildberger's 's' are related to even-powered Chebyshev polynomials of the first kind.


That seems to be the case, based on e.g. https://mathoverflow.net/questions/47520/spread-polynomials


Just like non-standard analysis it's mostly a solution in search of a problem. There's no evidence this improves pedagogy. So, it's just an interesting exploration of a different way of doing math, which is very much what mathematicians do. But as with many things, the cost of transitioning have to justify the switch even if you had a blank slate it might be better (something I don't buy necessarily).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: