Show HN: Touch Trigonometry – interactive way to understand the trig functions
by matthewtoast | 2026-02-23 20:56:03+00:00
I started to teach myself to code around 15 years ago. At the time I was working service industry jobs (restaurant kitchens, coffee shops) and desperate to change my career and life.

Around that time there was a new thing called <canvas> available in HTML5 that you could use to render graphics in web pages without plugins; despite my limited knowledge of tech and lack of coding skills, I knew I wanted to be a part of that.

Around that same time, I had also enrolled at the community college for night classes in math. I wanted to "work in tech" after all, so a mathematics brush-up seemed wise. I had always struggled with math. But now that I was both incentivized to learn it, I found myself facing a familiar terror: trigonometry.

The other students, just out of high school, seemed to know this stuff. I was simply confused. The same frustration I had felt in high school returned: No one could clearly answer why this stuff worked. Why did we need a "sine" function?

So I decided to combine my struggles and make them into a single creative project: I would code a way to visualize and understand the trig functions - and in so doing, I would learn trigonometry and HTML5.

I called it "Touch Trigonometry" and the idea was simple: You move your mouse, and the visualization of the trig functions would update. There would be a unit circle showing the angle. There would be a graph showing the plots. As a kinesthetic learner, I theorized that if I could simply "play with trigonometry" I could get an intuitive understanding of trig.

In the end, building it helped me grasp a concept that had always flummoxed me. And to my surprise, it got posted on HN and made it to the front page. It got many thousands of views and lots of comments on its Disqus message board.

Time went by; I moved onto other things; I gave up the domain and forgot about it.

Early this year I decided to see how quickly I could re-implement Touch Trigonometry again, this time in React Native, using Claude Code, in the form of an app. It took me around 8 hours of total coding time (that's including my own pondering, but not stuff like pushing to the App Store). It was easier this time, not just because of the AI agent at my disposal, but also because I already had a foundation in trig, much more experience as a software engineer, and a more concrete sense of what I wanted the UI to be.

There were a lot of friction points with Claude Code (circa Jan 2026). It could not "one-shot" this app, at least nothing like what I really wanted. It made poor recommendations on rendering and UI setup. UI rendering performance was bad at first, especially layering add'l visualizations like labels; only with considerable "coaching" cold Claude make it tolerable.

Notably Claude also had problems comprehending where to place elements in 2D space - especially with the default landscape orientation of the app. I had to manually place elements on the canvas to use as references it could understand. I had to rename many inaccurately named variables by hand - because its own naming conventions were leading it astray and causing more positioning and orientation mistakes. Even despite such interventions, it often did the orthogonal of what I asked.

I would guess that Claude's issues with spatial understanding are easily fixable on Anthropic's side. They could a bajillion synthetic examples to Claude's training data to give it a better understanding of how natural language spatial positioning instructions map to discrete code edits.

That said, once the essence was working, it was pretty simple to go from 90% complete to 99% complete. This app isn't perfect, and it needs a lot more refinement, but it was an interesting exercise to test what Claude Code's limitations are today.

Anyway, Touch Trig is now alive again and I overall it was a super fun side project to work on. It's very satisfying to see my old UI alive again in app form.