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

asked
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.

answered
User Teuneboon
by
8.6k points

No related questions found

Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.