Hacker News new | ask | show | jobs
by nikolay 1548 days ago
Back in the '80s in Bulgaria, I was only able to find the Bresenham's algorithm for circles, but needed to draw an ellipse (in 6052 assembly, well, machine code), and was so proud that I manage to do it.
2 comments

The lessons you learn on your own stick the best, don't they?

I remember a similar "heureka" moment when I derived a line-drawing algorithm that respected "subpixel" starting and ending points. That is, don't assume a line starts/ends in the middle of a pixel (like most algos do), but rather at an arbitrary point.

I forgot why I needed this (something to do with near-axis-aligned polygon slopes not looking right on a highly rasterized problem). But I do remember the elation when I finally got it to work :-) Also early 1990s, no internet and no English for extra fun.

Did it work for any axes?
As far as I can recall, yeah. By the way, I found this [0] implementation in pseudo code.

[0]: https://dai.fmph.uniba.sk/upload/0/01/Ellipse.pdf