Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The algorithm only works with points with integer coordinates, so the slope is always rational.


I think you have the last words because line drawing algorithms become irrelevant if you use a Floating Point Unit.

just:

{ x++ and y+=slope } or { y++ and x+= 1./slope }

Then slopes are always rational in line drawing algorithms.


If y and slope are floating point in the first block then might not y end at other than the desired endpoint because of accumulative error?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: