mirror of
https://github.com/zhigang1992/PerspectiveTransform.git
synced 2026-04-28 12:15:13 +08:00
implement adjugate via cross product of vectors
This commit is contained in:
@@ -7,10 +7,11 @@ class HomogeneousInverseSpec: QuickSpec {
|
||||
override func spec() {
|
||||
describe("homogeneousInverse") {
|
||||
context("multiply adj by vector") {
|
||||
let m = Matrix3x3Type([-122, -152, 18544, 122, 0, 0, 0, 152, 0])
|
||||
let expected = Matrix3x3Type([[0.0, 0.0, 1.0], [152.0, -0.0, 1.0], [-0.0, 122.0, 1.0]])
|
||||
|
||||
it("should match expected") {
|
||||
let m = Matrix3x3Type([-122, -152, 18544, 122, 0, 0, 0, 152, 0])
|
||||
let expected = Matrix3x3Type([[0.0, 0.0, 1.0], [152.0, -0.0, 1.0], [-0.0, 122.0, 1.0]])
|
||||
expect(m.homogeneousInverse()).to(beCloseTo(expected))
|
||||
expect(m.homogeneousInverse().zNormalized()).to(beCloseTo(expected))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user