Function plot_bresenham_line

Source
pub fn plot_bresenham_line<F, T, const N: usize>(
    start_point: Point<F, N>,
    end_point: Point<F, N>,
) -> Vec<Point<T, N>> 
Expand description

This is a free-form version of the bresenham line-drawing algorithm, allowing for any input, any output, and N dimensions, under the constraints of the function.

§Arguments

  • start_point: A Point of floating type F and N dimensions, representing the starting point of the line.
  • end_point: A Point of floating type F and N dimensions, representing the ending point of the line.

§Generics

  • F: either f32 or f64
  • N: a usize, representing the dimension to use

§Returns

A Vec of Points with inner type T, representing the drawn line, including the starting point and ending point.

NOTE: The returned Vec will always go from the starting point to the ending point, regardless of direction in axis.