///|
let canvas = @lib.canvas

///|
let color = @lib.color

///|
let point = @lib.point

///|
let ray = @lib.ray

///|
let sphere = @lib.sphere

///|
async fn main {
  let width = 300
  let height = 300
  let c = canvas(width, height)
  let red = color(1, 0, 0)

  // start the ray at z = -5
  let ray_origin = point(0, 0, -5)

  // put the wall at z = 10
  let wall_z = 10.0
  let wall_size = 7.0
  let pixel_size = wall_size / width.to_double()
  let half = wall_size / 2
  let shape = sphere()
  // shape.set_transform(mat4ident().scale(1, 0.5, 1))
  // shape.set_transform(mat4ident().scale(0.5, 1, 1))
  // shape.set_transform(mat4ident().scale(0.5, 1, 1).rotate_z(@math.PI / 4))
  // shape.set_transform(mat4ident().scale(0.5, 1, 1).shear(1, 0, 0, 0, 0, 0))

  // for each row of pixels in the canvas
  for y in 0.. println("error writing ch5.png")
  }
}