Bresenham

{#if invalidInput === true}

Invalid Input: Slope must be between 0 to 1.

{/if}  
 

Solution

{#if invalidInput === true}

Inavlid Input: Slope must be between 0 to 1.

{/if}
  Value
dx = |x1 - x0| {dx}
dy = |y1 - y0| {dy}
step = |2 * (dy - dx)| {step}
2 * dy {2 * dy}
Table {#each x_axis as _, i} {/each}
Iteration (k) Pk xk + 1 yk + 1
{i} {p_vals[i]} {x_axis[i]} {y_axis[i]}

Graph