tag:blogger.com,1999:blog-6314876008291942531.post521936534710628610..comments2024-01-14T00:36:43.430-08:00Comments on Antonio Gulli's coding playground: diagonals and interior points for rectanglesUnknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6314876008291942531.post-69336207763428357672011-07-07T22:43:30.388-07:002011-07-07T22:43:30.388-07:00thanks Stefano, that was good.thanks Stefano, that was good.codingplaygroundhttps://www.blogger.com/profile/08478993186814330588noreply@blogger.comtag:blogger.com,1999:blog-6314876008291942531.post-81953945411389818572011-07-04T09:27:16.945-07:002011-07-04T09:27:16.945-07:00x = gcd(a, b)
answer = x + a/x + b/x - 1x = gcd(a, b)<br />answer = x + a/x + b/x - 1Tejaswihttps://www.blogger.com/profile/12566170957042360561noreply@blogger.comtag:blogger.com,1999:blog-6314876008291942531.post-79782942235798817112011-07-04T09:26:13.810-07:002011-07-04T09:26:13.810-07:00gcd(a, b) + a + b - 1gcd(a, b) + a + b - 1Tejaswihttps://www.blogger.com/profile/12566170957042360561noreply@blogger.comtag:blogger.com,1999:blog-6314876008291942531.post-89514239979974641662011-07-04T08:25:58.672-07:002011-07-04T08:25:58.672-07:00Since I've a CG background, my answer is: use ...Since I've a CG background, my answer is: <a href="http://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html" rel="nofollow">use Bresenham's algorithm</a>Stefanohttps://www.blogger.com/profile/18281435598242421745noreply@blogger.com