         let t = transpose
         return t[0].toA() + t[1].toA() + t[2].toA()
     }
-
-}
+}
+
+extension float4 {
+    func toA() -> [Float] {
+        return [x,y,z,w]
+    }
+}
+
+extension float4x4 {
+    func toA() -> [Float] {
+        let t = transpose
+        return t[0].toA() + t[1].toA() + t[2].toA() + t[3].toA()
+    }
+    func toAA() -> [[Float]] {
+        let t = transpose
+        return [t[0].toA(), t[1].toA(), t[2].toA(), t[3].toA()]
+    }
+}
+
 
 class Quardilateral {
     let p1 : CGPoint

                        var withZ1 = float4()
                        withZ1[2] = 1
                        expect(expanded[2]) == withZ1
                    }
                }
            }

}


func transform(matrix:float4x4) -> CATransform3D {
    let c = matrix.toAA().map{$0.map{CGFloat($0)}}
    return CATransform3D(
        m11: c[0][0], m12: c[0][1], m13: c[0][2], m14: c[0][3],
        m21: c[1][0], m22: c[1][1], m23: c[1][2], m24: c[1][3],
        m31: c[2][0], m32: c[2][1], m33: c[2][2], m34: c[2][3],
        m41: c[3][0], m42: c[3][1], m43: c[3][2], m44: c[3][3]
    )
}

class ProjectionSpec: QuickSpec {
