I would like to find each integer coordinate point between 2 set of coordinate points.
For example, I need the coordinates between (2,15) (6,15). It should give me (3,15) (4,15) (5,15) . I cannot find any math formula or c++ code that does this.
I want all the coordinates on the line connecting the two points where both X and Y happen to be integers
(6,15)&(6,17) = (6,16)
The coordinates form a shape such as Rectangle or cross and the basic idea is to get the coordinates between each set of coordinates.
Rectabgle Shape
Point [1] : (2, 17)
Point [2] : (2, 15)
Point [3] : (6, 15)
Point [4] : (6, 17)
Points on perimeter : (2, 16), (3, 15), (4, 15), (5, 15), (6, 16), (5, 17), (4, 17), (3, 17)
Hope this explains better on what I want to achieve.