Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Stacking triangles for fun and profit (oranlooney.com)
193 points by olooney on April 11, 2024 | hide | past | favorite | 60 comments


I don't agree with the perspective taken here; I don't see any reason to think that the definition in terms of triangles is the simplest or most natural, and I suspect the author feels that way just because it's how they were first taught about trigonometrical functions.

Of course I do agree that definitions in terms of power series and differential equations are less natural and require heavier mathematical machinery.

But: the "right-angled triangle" definitions have the severe drawback of only applying to a restricted range of angles, and their relationship to those higher-tech definitions is more indirect than necessary.

Instead, I claim that the One True Definition of the trig functions is: if you start with the point (1,0) and rotate it through an angle t (anticlockwise, which is conventionally the "positive" direction in maths) about (0,0), then the point where it ends up is (cos t, sin t).

This is just as simple, and just as geometrical, as the "triangle" definition. It leads directly to the differential-equation characterization (which in turn leads easily to the power series). For angles between 0 and pi/2, it's obviously equivalent to the "triangle" definition.

Can you get the addition theorems easily from this definition? Yes, and (again) without the severe drawback of only applying when all the angles involved are between 0 and pi/2 as for the "triangle" definition.

Start with a diagram showing the points (0,0), (cos t, 0), (0, sin t), (cos t, sin t). Now rotate the whole thing through an angle u about the origin. Obviously (0,0) stays where it is. (cos t, 0) just goes to cos t times (cos u, sin u), i.e., to (cos t cos u, cos t sin u). If you turn your head through 90 degrees it becomes clear that (0, sin t) similarly goes to (- sin t cos u, sin t sin u). And of course (cos t, sin t) goes to (cos t+u, sin t+u) since we have rotated it through an angle t and then through an angle u.

And now we're done, because the "vector addition" property the original diagram had remains true after rotation, so adding (cos t cos u, cos t sin u) to (- sin t cos u, sin t sin u) has to give you (cos t+u, sin t+u). And that's exactly the addition theorems.

(That may be hard to follow with no diagrams, but I think it's easier to follow than the triangle-stacking proof would be without diagrams, and with diagrams everything is pretty transparent.)

The right-angled-triangle definitions are traditional because historically trigonometry came before coordinates. But now we have coordinates and generally learn about them before we learn trigonometry, and at that point the point-on-the-unit-circle definitions are simpler, more general, and better suited for proving other things.


You phrase this as a disagreement, but in my mind this is complementary.

The point of the post is that you should define things in terms of what you care about, and then prove stuff about it. The sum:

    Sum from n=0 to infinity of (-1)^n / (2n+1)! * x^(2n+1)
isn't something you should start with, it should be the punchline. Instead, you should start with angles (the thing you care about), then prove that they behave the same as that sum (what an incredible claim!).

The post proposed "angles of the acute corners of right triangles" as the starting point. You've argued very well that "angles in the unit circle relative to (1, 0)" is a better starting point. Pedagogically, I think it's a wonderful starting point:

"Let's talk about angles. Just angles, nothing else. When you look at angles of actual objects, the side lengths are all different, which complicates matters. Since all we care about is the angle itself, not the side lengths, let's make all side lengths equal to 1. Etc. etc."


It wasn’t a historical accident that triangles came before coordinates. Coordinates are more abstract than triangles quite generically for humans. (When we teach children numbers, we start with the natural numbers and then later introduce negative numbers.)

I claim it’s only because you and I have internalized them so well that they both seem intuitive, which is what allows you to prefer the coordinates approach due to its greater generality to negative angles.

In any case, as another commenter said, I think you basically agree with the author’s main point and are disagreeing with a minor point (which is to some extent a manner of taste).


This is another way of looking at the concept of Kolmogorov Complexity and relating it to real life... which thing you consider the most "natural" encoding of these concepts, and thus the "shortest", can depend very heavily on your "native mathematical language". One not even reach out to strange hypothetical aliens who think utterly different than us. Multiple people all firmly raised in the modern conventional human mathematical landscape can vary, as is seen right here.

Though it does occur to me to wonder what an alien in a very obviously hyperbolic universe would consider the most natural. Or one of the beings that lives in Greg Egan's universe with two time and two space dimensions.


I agree that the triangle-based definition starts breaking down once you get to angles greater than pi/2. I was told in school that "there are no right triangles with such angles, but just imagine that there were" and was then shown some weird (supposedly suggestive) diagrams. I found this unsatisfying and moreover hard to remember.

Of course, you could always just define sin and cos for acute angles only and then extend the definition with trig identities, but that seems rather unmotivated too.


Back in the day it was done via the unit circle. So the process goes something like this:

1. Define sin/cos as ratios in a triangle 2. Draw a unit circle with an appropriate triangle in the first quarter and note that for the vertex on the circle, x = cos alpha and y = sin alpha. 3. Assuming it holds for values of alpha > 90 deg, extend sin/cos definitions to match.

Don't quite remember how one got derivatives from that, because trig and calc were in separate modules. Possibly via the sum formula.


The only reason the author’s definition doesn’t apply to larger and smaller angles is that they explicitly considered the angles <ABC and <CBA to be equal rather than negatives of each other. That was a surprisingly odd oversight given that they immediately start talking about negative angles.


If you allow negative side lengths, as you should, much of geometry is unified and simplified, such as this situation.

Negative (and imaginary) measurements make math better-behaved. (See also: quantum mechanics.)

Rectangular coordinates are suboptimal because they are arbitrary in a way that hides some of the symmetry of mathematics.

Your vector argument looks like a lot of algebra noise "without a diagram" because it relies on... triangles... for intuitive justification.


The rotating angle suggests immediately the domain and definition of Sin(x), Cos(x) using simple projections. And, huuuuge bonus, that's a right triangle.

I just think lesson zero in the above article should have been these projections, and a simple "From this all angles can be defined as right triangles in your preferred coordinate system", and you're off to the races in any old direction.

This is not how I was taught it, and I'm retrospectively upset.


> Instead of adding two separate angles α and β, we’ll use θ and −θ.

It's not clear that the geometric proof based on pictures with positive angles α and β also applies to a negative β. I think one should at least provide a separate picture of that case...


> If you allow negative side lengths, as you should [...]

I mean, the blog post was about a pedagogically better suited construction of trig functions. If we allow negative side lengths, it's not really going to be intuitive anymore. At this point, you might just as well use the power series definition (or the one based on the complex exp function) since it makes things easy to prove.


Imaginary lengths may be unintuitive but negative is pretty simple.

The idea of negative measurements (meaning "opposite direction along a line") as is well understood before children study geometry. Kindergarteners learn "left" vs "right" and "forward" vs "backward".

I agree with other poster about the value of showing negative and positive lengths visually in the same diagram.


Magnitudes are intuitionally directionless (hence why norms and measures are nonnegative reals). Of course, you can extend notions suitably and make it work, but I really don't think that this is terribly intuitive. (Of course, different people will find different things intuitive.)


Could you expand on getting the differential equation from your definition? I don't really where to start from it.


Draw a line of length 1 which makes an angle of p with the positive x axis. The x and y coordinates of a, the point at the end of the line give cos(p) and sin(p).

Now think about what happens if you increase p by a tiny bit. a moves tangentially. (This works very similar to how the tangent to a curve gives the change in y for a change in x.) So the vector of cos'(p), sin'(p) is given by a vector starting from a, at a right angle to 0a, and pointing in the positive direction.

Since the point a moves through 2pi distance while p goes from 0 to 2pi (the definition of measuring angles in radians) the speed of the point is 1, and so the vector of derivatives has length 1.

You can check easily that this makes cos'(p) = -sin(p) and sin'(p) = cos(p).


Yup!

(If I were trying to present this stuff in a maximally-elegant order without too much regard for what order human brains like to learn things in, the order of things would be: complex numbers, calculus, trigonometry. Then we define something that we might initially call e(t) to satisfy the differential equation de/dt = ie, and observe that having e and e' at right angles means that |e| remains constant, which means that |e'| also remains constant, so if we start with e(0)=1 then we have a point moving at unit speed around the unit circle, etc. Keep the linkage between the geometrical and formal points of view there at all times. But I suspect this wouldn't be great paedagogically for the majority of students.)


>> What struck me as odd when I was an undergraduate, and still strikes me to this day, is that none of these are the obvious trigonometric definitions about the opposite and adjacent sides of a right triangle.

I had the less common experience of learning some graphics programming prior to taking a trig class in school. "How do I draw a circle?" You sweep an angle from 0 to 360 (or 2*pi) and use sin() and cos() to get points on the unit circle, then multiply by your radius and plot them. For me the notion of sin and cos being coordinates of points on a unit circle was natural. Later when I had trig class it seemed really weird to define these functions as ratios of sides of a triangle. In particular you never talk about a side length as being negative. So no, it's not universal that the triangle definitions seem more obvious or make more intuitive sense.

I think this is important for people to understand. What seems easy or natural can depend on how your particular tree of knowledge was constructed.


I remember wondering what these strange "sin" and "cos" functions were in Delphi 2 or something – it was ~1997 and I couldn’t just google it – and tried to find a pattern in the seemingly arbitrary output values. I don’t think trying to plot them as y=f(x) crossed my mind, not at first anyway, but instead I somehow ended up trying to plot x=k sin(t), y=k cos(t) and was amazed when I realized that they traced a circle on the screen. Only later I learned in school that they had anything to do with triangles. To me they were functions for emitting circle coordinates first and foremost.


That's too bad -- I am pretty sure my trig class introduced unit circles and the triangle relationships at around the same time.

The unit circle with key points labeled is still my go-to doodle; it is a beautiful set of concepts.


In fact, sine and cosine never really made sense to me, until one day, I saw an animation similar to this one: https://youtu.be/Q55T6LeTvsA?si=7fiBxFVMu67tb3NZ (without the overly dramatic soundtrack).

Before that it was just some weird function I needed to calculate angles in triangles…


Yes this article really should have animations to get its point across. Seems like such a natural fit while going through the effort of writing it and much less engaging as a result.


My experience was similar. I never really understood the point of sin and cos until I used them to draw circles on a TRS-80. And then it's like "Oh, they are very useful and straightforward functions." And then it made sense why you'd divide a triangle's side length by the hypotenuse, since that's just scaling by the radius.


One of the nicest definitions of the six basic trig functions involves drawing an ray from the origin of a unit circle with its center at the origin.¹ Where the ray intersects the circle at point A draw a vertical line perpendicular to the x axis. The height of the line segment from A to the x axis will be the sine of the angle between the ray and the x axis. The length of the line segment from the origin to where your vertical line hits the x axis will be the cosine.

Now, draw a tangent line perpendicular to the x axis and find the point B where your ray intersects the tangent line. The length of the segment from the origin to B will be the secant, the length of the segment from B to the x axis will be the tangent.²

Finally, draw the tangent line parallel to the x axis and find the intersection of the ray with that line at C. The length of the segment from C to the origin will be the cosecant and the segment from the y axis to C will be the cotangent.

You can use your basic trig identities and knowledge of similar triangles to verify the relationships between the functions and the triangles. Angles outside the first quadrant will give signed values that make sense if you consider segments going down or left to be negative (but down and left is positive).

1. I’m making reference to cartesian coordinates strictly for the sake of convenience since I’m using only words to describe a diagram.

2. I’m doing this from memory and really hoping I’m not mixing up the tangent, cotangent, secant and cosecant


I think I have somewhere a nice drawing of this I did in Illustrator back in grad school.


Maybe I just got lucky, but that's pretty much exactly how I remember being taught in high school calculus class. No ODEs or anything of course, but the teacher started from the geometry, then moved to the trig functions and identities, and finally to derivatives and Taylor / Maclaurin series.

It's a good post, and I agree--there is just no hope in getting students to develop any kind of intuition in math without starting from something really simple like the geometry of the problem. Plus, it's way more fun!


I think fun in learning comes mostly from the "intuition reward". If you understand and _feel_ some abstract concept in an intuitive manner, you will feel happy and you will probably want more of that. So, for teachers finding ways to teach concepts that can trigger students intuition, in my experience as a student, will get more engaged students.


My math teacher was teaching us Trigonometry without ever showing the unit circle, and the class was completely befuddling to me and other students. This was pre-internet, and I stumbled across the unit circle in a book and the meaning of sine, cosine, etc. on it - and was like a huge revelation to me and others.

I've enjoyed trig since, and one of the few math topics I continue to use to this day.


I remember just learning to code at a young age, but not knowing trig or seeing how it applied because I only knew it as being about triangles.

I had learned to use some game graphics library (specifically DJGPP with Allegro, coding in C) and I was trying to make a 2d spaceship game, think like asteroids, where you can turn the ship and apply thrust. I couldn't figure out how to take the angle the ship was facing and get a direction to move. Basically I needed to understand the unit circle. I eventually found what I needed probably on some old internet forums. From that point on, trigonometry really started making sense to me.


I have my old high school calculus text book and that is definitely how trig was introduced. The proof of Pythagorean Theorem using sin and cos was literally part of my undergrad CALC101 (I remember because my high school teacher demonstrated it for fun so it was a rehash)


When were you in Calc 101?

Before or after 2009?

https://forumgeom.fau.edu/FG2009volume9/FG200925.pdf


Before. It was clearly circular since the identity was assumed, the calc prof might have acknowledged this at the time.


I do not understand this consideration: > By considering a triangle with hypotenuse 1 and a very small “opposite” side, it’s not hard to see geometrically that sin(x)≈x and cos(h)=x when x is small

I fail to see how you can "see" finer than sin(h) -> 0 & cos(h) -> 1

From the limit definitions you actually need :

* (1-cos(h)) / h -> 0

* sin(h)/h -> 1

(which correspond to the derivatives at 0).


That one line was the part that stood out to me the most as well, but:

If you zoom in sufficiently at x = 0, f(x) = sin(x) looks indistinguishable from f(x) = x, whereas g(x) = cos(x) looks indistinguishable from g(x) = 1.

(also, sin(x) is negative approaching 0 from the left and positive approaching 0 from the right)


> If you zoom in sufficiently at x = 0, f(x) = sin(x) looks indistinguishable from f(x) = x, whereas g(x) = cos(x) looks indistinguishable from g(x) = 1.

You can't use the plot as you only know the triangle definition yet. (And "looks indistinguidable" is rather handwavy).

> (also, sin(x) is negative approaching 0 from the left and positive approaching 0 from the right)

That only tells you that sin(0)=0


Your limit definition is the same as the part you quoted, so it's not clear what your question is. I also don't see what you are quoting.

Curvature is inverse of radius.

Decreasing angle is equivalent to increasing radius, and this decreasing curvature. This, as angle decreases, the curve becomes close to a straight line, and that straight line approaches a vertical line.

As usual, 3B1B created a quintessential visualization and explanation.https://m.youtube.com/watch?v=S0_qX4VJhMQ


I quote the second paragraph of the Derivatives section. (which was edited to a better, but not yet enough, sin(h)≈h and cos(h)≈1 when h is close to zero).

I perfectly understand that around 0, sin(x) ~ x and cos(x) = 1 + o(x) but it isn't obvious geometrically, unlike what the article implies.

From my point of view, increasing radius / decreasing curvature only gets you sin(x) -> 0 ; cos(x) -> 1, but that isn't enough to obtain the derivatives.

I found a geometric proof in [1] but that part is the longest and hardest of the page. I was wondering whether the author found a clearer way to express is.

[1] https://www.mathsisfun.com/calculus/derivatives-trig-proof.h...

EDIT: after looking at 3B1B's video, the "small" triangle d(sinΘ) by dΘ figure would be a better way to explain the derivative, rather than an "not hard to see geometrically" approximation that isn't enough to conclude.


Came here to say the same thing. But I suppose if you extend cosine into negative values you'll see it has a maximum at zero so its derivative must be zero. Don't know about sin'(0) offhand but you'd think it wouldn't be hard.


The article initially points out that in mathematics, there are often equivalent definitions, that each have their own benefits and drawbacks. I think the author could have just written "I have found an alternative approach" instead of "I have found a better approach".

As others have noted here, the geometric argument only works "intuitively" for acute angles and the functions have to be explicitly extended. Still, I hadn't seen this proof of the angle addition formula yet, and I found it neat.

From a point of view of formalisation, a power series based approach (either directly or via the complex exp function) as traditionally used is probably better, because going into analysis (especially complex analysis), you're going to need power series anyway. Geometry meanwhile is intuitive to us but you'd have to encode a bunch of Euclidean axioms and theorems beforehand, which you might not otherwise use. Also, for better or worse, many mathematicians aren't really taught axiomatic geometry (I wasn't at least).


I started reading this, and the article is very approachable, but it’s flawed from almost the very beginning.

He uses the angle addition formulas to derive the Pythagorean theorem, but this derivation only works because he predefined sine and cosine as odd and even functions, which hasn’t been proven


He did gloss over it, but odd cos and even sin is obvious as soon as you define signed angles (which and lengths (which he forgot to mention).

Sin(t) clearly has the same sign as t. (That's why it's called "sin" ;-) )


Also fun exercise:

Go through Euclid's Elements (i.e. http://aleph0.clarku.edu/~djoyce/elements/bookI/bookI.html)

Read the definitions and then prove all the postulates yourself, in order.


> none of these are the obvious trigonometric definitions about the opposite and adjacent sides of a right triangle

Am I just misunderstanding something about this articles motivation? I’m pretty sure I learned the unit circle in high school trig, possibly even 7th grade geometry although my memory that far back is fuzzier; but we did lots of geometric constructions with straightedge and compass, and did basic geometric proofs using complementary angles etc, and my teacher was obsessed with triangles. I didn’t learn about series until Calc 2 in early undergrad.

I still use the unit circle to reconstruct various trig properties from memory.


His claim is that sin and cos in calculus are often introduced independently of geometry, as math for engineers is non rigorous, and the connection to triangles is a magical coincidence.

See also "Early vs Late Transcendentals" in calculus pedagogy.


I agree, and the linked Wikipedia page starts out with the obvious definitions as well:

    In mathematics, sine and cosine are trigonometric functions of an angle. The sine and cosine of an acute angle are defined in the context of a right triangle: for the specified angle, its sine is the ratio of the length of the side that is opposite that angle to the length of the longest side of the triangle (the hypotenuse), and the cosine is the ratio of the length of the adjacent leg to that of the hypotenuse.
The author's claim that other definitions are the "most common starting points" seems like a straw man.


I wonder if the author of this article would like Norman J. Wildberger's work on rational trigonometry[0], which also argues that angles and unit circles are the wrong starting point for defining triangles.

[0] https://en.wikipedia.org/wiki/Divine_Proportions:_Rational_T...


This is absolutely great, easy to follow and explain. I love it! However it is incomplete, and thus doesn’t work as a proof.

As the angles increase, the 2 triangles will no longer be inside the rectangle. Signs start to flip around and extra work is needed to show the sin(a+b) and cos(a+b) equations are sound. The bright side is this is a good asignment for the student.


I have created a simple geogebra Applet applying your method step by step: https://www.geogebra.org/m/enztf4s6


My daughter (in 5th grade) is interested in learning advanced maths, so we looked at sine and cosine.

Question: is there an easy, geometrical way to "show" that `cos(60º)=1/2` using the intuitive definition based on the trigonometric circle?


Yes.

(I assume that by "the intuitive definition based on the trigonometric circle" you mean that (cos t, sin t) is the point at angle t on the unit circle. If you meant something else, then what follows may not be helpful.)

APPROACH 1

If you take the point (1,0) and rotate it anticlockwise through 60º about the origin, you get (cos 60º, sin 60º), by definition. Look at the triangle formed by (0,0), (1,0), and (cos 60º, sin 60º). The angle at the (0,0) vertex is 60º. The other two angles are equal because the triangle is isosceles (rotating a line segment doesn't change its length) so they must also be 60º since the angles in a triangle add up to 180º.

So now drop a perpendicular from (cos 60º, sin 60º) down to the horizontal side of the triangle; it lands at (cos 60º, 0), so cos 60º is the distance from (0,0) to that point, and 1-cos 60º is the distance from (1,0) to that point. But those distances are the same, by symmetry, and now we're done.

APPROACH 2

Draw the unit circle and inscribe a regular hexagon in it with (1,0) as one vertex. Divide it up into six triangles by drawing radii. As above, these are equilateral triangles.

So now look at the horizontal separation between the opposite points (-1,0) and (1,0). Obviously the distance is 2 units. But we can split it up a different way: we have a horizontal distance 1-cos 60º from either of those to the next point around the circle, then 1 from that to the next point, then 1-cos 60º back to the opposite point. So 2 = (1-cos 60º)+1+(1-cos 60º) and again we're done.

(But I think any proof of this particular thing is going to be basically about equilateral triangles more than it's about circles. It might be easier first to show that for angles between 0 and 90º the trig functions have their "traditional" definition in terms of right-angled triangles, and then bisect an equilateral triangle.)


Yes! Draw an equilateral triangle with side length one. Then cut it in half and reason from there.


Pretty sure we used to have posters of this and similar figures in middle school classrooms.


As a side comment to sibling comments with various approaches, there's a handy bit of intuition/technique to this that's useful for 5th to 105th graders - when you notice 'useful' angles in a plane geometry problem, make the thing they suggest out of them. So, 60 deg angle is a piece of an equilateral triangle - finish the whole triangle and see if you get any ideas. The unit circle sin/cos thing teaches you all sorts of stuff about right-angled triangles. See a problem without a right angled triangle? Draw a line to add one, etc.


Useful angles are the only exact angles that really exist :-)

Everything else is a brutish approximation.


Of course, 'useful' and 'brutish' can be stretched a bit. Maths olympiad problem (from right around 5th grade, to boot):

Trisect a 36° angle.


If you look at a regular hexagon inscribed in a circle (i.e. whose vertices are determined by 6 rotations of 60 degrees whose end point returns to the starting position), the length of one edge is equal to the radius (this could be demonstrated based on symmetry, because in the triangles formed by 1 edge and 2 radii all angles are equal, therefore also all edges).

The cosine of 60 degrees is one half of the edge divided by the radius, i.e. divided by the edge, therefore it is 1/2.


I guess it's all in the way you look at things. I would say that the addition formulae for sine and cosine are more weird and technical than the Banach fixed point theorem, which I would say is much more fundamental.


I think there's a bit of a straw man here pointing at the series definitions as being applied as the "intuitive" sense for sin and cos.

Instead, I find that the intuition that's sought is more to start by seeing exp(it) as being a generator of complex rotation---a tremendously beautiful and parsimonious bit of theory---and then seeing sin and cos as being 1-dimensional coordinate projections of that.

Then the series definitions are just cute ways of deriving that relationship formally.

Circles over triangles.


> Now, the line EC is perpendicular to AB, and the line BC is perpendicular is AC, so the angle ∠BCE is the same as the angle ∠CAD which we called α.

I'm hoping that's a typo, and should be:

> Now, the line EC is perpendicular to AD, and...

(Edit: although I vaguely recall in school doing that bit as the sum of the angles around point C)


Yes, I'm pretty sure you're correct, I did stumble over this too.


ok




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: