News for hackers. Stuff that matters.
Re:Why do we round corners? by perilunar on Monday February 14, 2022 @08:02PM (#30341116)
How can you write an article on rounded corners without mentioning Steve Jobs and Bill Atkinson?

https://www.folklore.org/StoryView.py?story=Round_Rects_Are_...

Re:Why do we round corners? by JKCalhoun on Monday February 14, 2022 @09:29PM (#30341908)
I was expecting the same.

I don't agree with a lot of what Jobs did, but he was absolutely right about rounded rectangles.

> Bill's technique used the fact the sum of a sequence of odd numbers is always the next perfect square (For example, 1 + 3 = 4, 1 + 3 + 5 = 9, 1 + 3 + 5 + 7 = 16, etc). So he could figure out when to bump the dependent coordinate value by iterating in a loop until a threshold was exceeded. This allowed QuickDraw to draw ovals very quickly.

Still blows my mind. I have a hankering to try to blind-rewrite this algorithm knowing only the above.

Re:Why do we round corners? by unnah on Tuesday February 15, 2022 @03:38AM (#30344094)
That would be a variant of Bresenham's circle algorithm: https://en.wikipedia.org/wiki/Midpoint_circle_algorithm

Certainly a fun exercise...

Re:Why do we round corners? by bobbylarrybobby on Monday February 14, 2022 @10:12PM (#30342247)
Were square roots really so slow that integer addition in a loop was faster??
Re:Why do we round corners? by the2and7 on Monday February 14, 2022 @10:28PM (#30342372)
68000 processor on the Mac didn't support floating point operations.
Re:Why do we round corners? by dahfizz on Monday February 14, 2022 @11:55PM (#30342942)
I wouldn't be surprised if that is still the case. Rule of thumb is that sqrt is on the order of 10x as expensive as integer addition, though this obviously depends on a lot of factors.
Re:Why do we round corners? by PaulDavisThe1st on Monday February 14, 2022 @08:17PM (#30341260)
I'm "old", but I know that not every article about X has to be full history of X.
Re:Why do we round corners? by perilunar on Monday February 14, 2022 @08:32PM (#30341383)
Well sure, but the first sentence of the article is practically the title of Andy Hertzfeld's post. It would have been perfect for a link at least.