135k views
0 votes
Give two points with integer coordinates that have a slope of 2/5 between them.

User Mrpandey
by
4.7k points

1 Answer

3 votes

Answer:

yes

Given a 2D line e.g. (3,10) -> (8.3,16.5), how can I find any point on that line that has has whole-number coordinates?

I can easily iteratively walk along one of the axis in integer steps, seeing if the value on the other axis is integer, but this is slow for very very long lines.

User Teuneboon
by
5.0k points