Skip to content

Commit

Permalink
update exp tests for norm flag (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium authored Feb 21, 2022
1 parent 688e167 commit 766add4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/test_Quaternion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,23 @@ for _ in 1:100
end

@testset "exp" begin
@test exp(Quaternion(0, 0, 0, 0)) == Quaternion(1, 0, 0, 0, true)
@test exp(Quaternion(2, 0, 0, 0)) == Quaternion(exp(2), 0, 0, 0, false)
@test exp(Quaternion(0, 2, 0, 0)) == Quaternion(cos(2), sin(2), 0, 0, true)
@test exp(Quaternion(0, 0, 2, 0)) == Quaternion(cos(2), 0, sin(2), 0, true)
@test exp(Quaternion(0, 0, 0, 2)) == Quaternion(cos(2), 0, 0, sin(2), true)
@test exp(Quaternion(0, 0, 0, 0)) === Quaternion(1., 0., 0., 0., true)
@test exp(Quaternion(2, 0, 0, 0)) === Quaternion(exp(2), 0, 0, 0, false)
@test exp(Quaternion(0, 2, 0, 0)) === Quaternion(cos(2), sin(2), 0, 0, true)
@test exp(Quaternion(0, 0, 2, 0)) === Quaternion(cos(2), 0, sin(2), 0, true)
@test exp(Quaternion(0, 0, 0, 2)) === Quaternion(cos(2), 0, 0, sin(2), true)

@test norm(exp(Quaternion(0, 0, 0, 0))) 1
@test norm(exp(Quaternion(2, 0, 0, 0))) 1
@test norm(exp(Quaternion(0, 2, 0, 0))) 1
@test norm(exp(Quaternion(0, 0, 2, 0))) 1
@test norm(exp(Quaternion(0, 0, 0, 2))) 1

@test exp(Quaternion(0., 0., 0., 0.)) == Quaternion(1, 0, 0, 0, true)
@test exp(Quaternion(2., 0., 0., 0.)) == Quaternion(exp(2), 0, 0, 0, false)
@test exp(Quaternion(0., 2., 0., 0.)) == Quaternion(cos(2), sin(2), 0, 0, true)
@test exp(Quaternion(0., 0., 2., 0.)) == Quaternion(cos(2), 0, sin(2), 0, true)
@test exp(Quaternion(0., 0., 0., 2.)) == Quaternion(cos(2), 0, 0, sin(2), true)
@test exp(Quaternion(0., 0., 0., 0.)) === Quaternion(1., 0., 0., 0., true)
@test exp(Quaternion(2., 0., 0., 0.)) === Quaternion(exp(2), 0, 0, 0, false)
@test exp(Quaternion(0., 2., 0., 0.)) === Quaternion(cos(2), sin(2), 0, 0, true)
@test exp(Quaternion(0., 0., 2., 0.)) === Quaternion(cos(2), 0, sin(2), 0, true)
@test exp(Quaternion(0., 0., 0., 2.)) === Quaternion(cos(2), 0, 0, sin(2), true)

@test norm(exp(Quaternion(0., 0., 0., 0.))) 1
@test norm(exp(Quaternion(2., 0., 0., 0.))) 1
Expand Down

0 comments on commit 766add4

Please sign in to comment.