Bresenham’s line drawing algorithm implementation in 2D and 3D dimensions