     expectPositionsEqual cap, {x: 0, y: 50}
 
   xit 'works at 2x zoom, 30 degrees', ->
-    cam = new Camera 100, 100, 100 * Camera.MPP, 2 * 100 * Camera.MPP, testLayer, 2, null, Math.PI / 6
+    cam = new Camera { attr: (x) -> 100 }, 100 * Camera.MPP, 2 * 100 * Camera.MPP
     expect(cam.x2y).toBeCloseTo 1
     expect(cam.x2z).toBeGreaterThan 9001
     checkCameraPos cam

    expectPositionsEqual cap, {x: 50, y: -100}

  it 'works at 2x zoom, 60 degree hFOV', ->
    cam = new Camera { attr: (x) -> 100 }, 100 * Camera.MPP, 100 * Camera.MPP, testLayer, 2, null, null, 0.01
    checkCameraPos cam

  xit 'works at 2x zoom, 60 degree hFOV, 40 degree hFOV', ->
    cam = new Camera { attr: (x) -> x is 'height' ? 63.041494 : 100 }, 100 * Camera.MPP, 63.041494 * Camera.MPP, testLayer, 2, null, null, Math.PI / 3
    checkCameraPos cam

  xit 'works on a surface wider than it is tall, 30 degrees, default viewing upper left corner', ->
    cam = new Camera 100, 100, 200 * Camera.MPP, 2 * 50 * Camera.MPP, testLayer, 1, {x: 0, y: 0}, Math.PI / 6
    checkCameraPos cam
    expect(cam.zoom).toBeCloseTo 2
    wop = x: 5, y: 4, z: 6 * cam.y2z  # like x: 5, y: 10 out of world width: 20, height: 10

                checkCameraPos cam, wop

  it 'works at 90 degrees', ->
    cam = new Camera { attr: (x) -> 100 }, 100 * Camera.MPP, 100 * Camera.MPP
    expect(cam.x2y).toBeCloseTo 1
    expect(cam.x2z).toBeGreaterThan 9001
    expect(cam.z2y).toBeCloseTo 0

  it 'works at 0 degrees', ->
    cam = new Camera { attr: (x) -> 100 }, 100 * Camera.MPP, 100 * Camera.MPP
    expect(cam.x2z).toBeGreaterThan 9001
    expect(cam.x2y).toBeCloseTo 1
    expect(cam.z2y).toBeCloseTo 0

  it 'works at 45 degrees', ->
    cam = new Camera { attr: (x) -> 100 }, 100 * Camera.MPP, 100 * Camera.MPP
    expect(cam.x2y).toBeCloseTo 1
    expect(cam.x2z).toBeGreaterThan 9001
    expect(cam.z2y).toBeCloseTo 0

  xit 'works at default angle of asin(0.75) ~= 48.9 degrees', ->
    cam = new Camera { attr: (x) -> 100 }, 100 * Camera.MPP, 100 * Camera.MPP
    angle = 1 / Math.cos angle
    expect(cam.angle).toBeCloseTo angle
    expect(cam.x2y).toBeCloseTo 1
