Skip to content

LineB* over A -> B and B -> A do not always match #25

@nxsaken

Description

@nxsaken

Same line segments in opposite octants can be off by one pixel. See (0,0)→(8,3) vs. (8,3)→(0,0):

FWD   BWD
(0,0) (8,3)
(1,0) (7,3)
(2,1) (6,2)
(3,1) (5,2)
(4,2) (4,1) <- off-by-one
(5,2) (3,1)
(6,2) (2,1)
(7,3) (1,0)

This is not a bug. Most implementations of Bresenham's algorithm are not symmetrical. However, if this were not an issue, implementing #24 would be easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    researchResearch is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions