fishdist.bresenham_nd

bresenham_nd(start, end)

Generate integer coordinates of a line between two points in N-dimensional space using the Bresenham algorithm.

Parameters:
  • start (array - like) –

    Starting coordinate (int or float) of the line.

  • end (array - like) –

    Ending coordinate (int or float) of the line.

Returns:
  • np.ndarray: Array of integer coordinates representing the Bresenham line from start to end.

Example
>>> import numpy as np
>>> bresenham_nd([0, 0, 0], [3, 2, 1])
array([[0, 0, 0],
       [1, 1, 0],
       [2, 1, 1],
       [3, 2, 1]])