Hacker News new | past | comments | ask | show | jobs | submit login

> I learned sine and cosine from the diagrams in the manual years before we covered them in maths.

You too?

I didn't fully understand them, and thought they had more to do with circles than triangles, but yeah that circle drawing code in the Spectrum manual was my first exposure to sin and cos.




Same! I had the Spectrum +2A model, which had a bunch of issues running older software. The OCP Art Package didn't work at all, so I ended up writing a really awful drawing program in BASIC. Figured out how to poll the mouse, detect button presses etc. I drew a toolbar on the left of the screen depicting squares, circles etc. If the mouse button was pressed within one of those, the drawing mode was changed. That would let me draw the objects on screen. That was also where I learned what sin and cos "really" did. Never got the bucket fill to work 'properly' - didn't know if BASIC 'gosub' supported recursion, and I can't even remember if I tried.


Genuine question: I had a 2a+ too, it crashed all the time. Really frustrating. I believe it was because amstrad bought spectrum and started building them cheaper. Did your crash all the time?


Yeah. My friend had a +2 and it was solid. Didn't crash that much, worked with the older 48k software. The +2A was junk but it definitely taught me to be patient and persistent with shitty tech. Seems like my whole career has been based on that.


It's somehow a relief to hear someone else had this same childhood experience!


Oh wow. Memories.

Sin/Cos were just the gateway drug. To do interesting stuff on the computer, I ended up learning matrix algebra (for rotating things on screen) and even simple calculus (filling out areas) years before they were mentioned at school. When school math caught up, my math grades shot thru the roof - while remaining a below-avg student on everything except math and science.

I used to literally bring the spectrum programming manual with me to all our vacations - using it to hand "assemble" assembly programs into machine code (I had never heard of an assembler - and I won't have had any way to get my hands on one even if I had known about them) so that I could type them in when we got back home.


Wanting to do my own 3D graphics after playing Elite was a strong motivator. I figured out all the rotation maths just by drawing triangles on paper and figuring out what the angles were and therefore the formulas. You might be able to find fragments of graphics math in library books and then photocopy it - I remember reading about hidden surface removal by calculating the normals to the faces and their direction to the viewer. I know I had a rotating cube written in BASIC at some point. I don’t remember learning the cross product in school until A levels though!

My dad took the day off work to take me to the PC show at Earls Court in I think 1988. I spent my hard earned paper round money on the assembler and it massively improved my productivity.

I figured out how to do multiplies and divides on the Z80 while doing my paper round. In retrospect it was just long division but it wasn’t obvious to me at the time!

There were lots of other little math tricks that having a slow processor taught you. If you tried to draw circles by calculating sine and cosine it was too slow. Instead you rotated each point by a fixed angle and then used reflections to use that to plot eight points at a time.

All this stuff is still super useful. I drop down to look at the disassembly of x64 code all the time. Large code bases don’t scare me. You have source code! I had to disassemble games and ROMs to figure out how they worked - printing out fragments and then annotating them. The disassembler took 5KB of space so you’d have to load it in at different addresses to get at all the code.


> thought they had more to do with circles than triangles,

But that is exactly right!


sin and cos come from trigonometry (from Greek trigōnon, "triangle" and metron, "measure"). But they can be used for lots of other things, including calculating how to rotate an object or draw a circle.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: