Hi Andrzej, I took the one below "Kompakte Variante" from the german wiki http://de.wikipedia.org/wiki/Bresenham-Algorithmus
Maybe I miss something, but I don't see how I could calculate a grid point on the line as I think that's the initial problem that I try to solve with the loop. I guess I should get my result by calculating the intersections of the given line with a few horizontal and vertical lines going through the grid points next to the calculated point on the line (using float arithmetic) Not sure if the code for that is simpler... Gerd popej wrote > Hi Gerd, > > > Or do you see a simple way to limit the > > iteration to a part of the way near the wanted point? > > I have looked at algorithm here: > http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm > > It looks simple, it calculates error to grid at each step by adding a > value representing ascent (or descent) of a line. If error is bigger > than 0.5 grid, then coordinate is increased and error recalculated > against new coordinate. State of algorithm is defined by 3 values: grid > coordinates and error. I think there shouldn't be a problem, to restore > these 3 variables for any point (grid point) of a line and then make > next 10 iterations. > > -- > Best regards, > Andrzej > _______________________________________________ > mkgmap-dev mailing list > [email protected] > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- View this message in context: http://gis.19327.n5.nabble.com/help-needed-for-graphical-problem-tp5833271p5833403.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list [email protected] http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
