Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
let inline bresenham fill (x0, y0) (x1, y1) =
|
||||
let steep = abs(y1 - y0) > abs(x1 - x0)
|
||||
let x0, y0, x1, y1 =
|
||||
if steep then y0, x0, y1, x1 else x0, y0, x1, y1
|
||||
let x0, y0, x1, y1 =
|
||||
if x0 > x1 then x1, y1, x0, y0 else x0, y0, x1, y1
|
||||
let dx, dy = x1 - x0, abs(y1 - y0)
|
||||
let s = if y0 < y1 then 1 else -1
|
||||
let rec loop e x y =
|
||||
if x <= x1 then
|
||||
if steep then fill y x else fill x y
|
||||
if e < dy then
|
||||
loop (e-dy+dx) (x+1) (y+s)
|
||||
else
|
||||
loop (e-dy) (x+1) y
|
||||
loop (dx/2) x0 y0
|
||||
Loading…
Add table
Add a link
Reference in a new issue