Skip to content

Commit

Permalink
test for translate_points(P,Q)
Browse files Browse the repository at this point in the history
  • Loading branch information
gp0 committed Mar 21, 2015
1 parent 4aac45e commit 9e17964
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/KABSCH/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ centroid = calc_centroid(P)
@test_approx_eq_eps centroid[2] -0.199999 1e-4
@test_approx_eq_eps centroid[3] 2.766666666666667 1e-4



P = [51.65 -1.90 50.07;
50.40 -1.23 50.65;
50.68 -0.04 51.54;
Expand All @@ -20,6 +22,19 @@ Q = [51.30 -2.99 46.54;
52.36 -1.20 48.03;
52.71 -1.18 49.38]

T1, T2, centroid_p1, centroid_p2 = translate_points(P, Q)

# (bad) lazy test if translated matrices are OK ("collisions" obviously can exist)
@test_approx_eq_eps sum(T1) -2.2828578949e-05 1e-4
@test_approx_eq_eps sum(T2) 1.09672546387e-05 1e-4

c_1 = [ 50.73750305 -0.79750001 51.27750397]
c_2 = [ 51.86499786 -1.81249988 47.88249969]

@test_approx_eq_eps centroid_p1[1] c_1[1] 1e-4
@test_approx_eq_eps centroid_p1[2] c_1[2] 1e-4
@test_approx_eq_eps centroid_p1[3] c_1[3] 1e-4

@test_approx_eq_eps rmsd(P,Q) 3.87845580529 1e-4

@test_approx_eq_eps kabsch_rmsd(P,Q) 0.00304375026351 1e-5
Expand Down

0 comments on commit 9e17964

Please sign in to comment.