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

User Mrpandey
by
7.5k 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
8.6k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories