Kabsch
Documentation for Kabsch.
Kabsch.centered
— Functioncentered(P)
Return the point set P
centered at the origin, allowing for batch dimensions.
Kabsch.centroid
— Methodcentroid(P)
Return the centroid of a point set P
, reducing the second array dimension with Statistics.mean
, allowing for batch dimensions.
Kabsch.kabsch
— Methodkabsch(P, Q)
Returns a rotation matrix R, and centroids of P and Q, where rmsd
is minimized between a centered P and R applied to a centered Q.
julia> using Manifolds
julia> Q = randn(3, 4);
julia> P = rand(Rotations(3)) * centered(Q) .+ randn(3);
julia> R, Pₜ, Qₜ = kabsch(P, Q);
julia> (P .- Pₜ) ≈ R * (Q .- Qₜ)
true
Kabsch.rmsd
— Methodrmsd(P, Q)
Return the Root Mean Square Deviation between two paired sets of points. Note that this method does not align the two sets by itself.
julia> P = randn(3, 4);
julia> rmsd(P, P) == 0
true
julia> rmsd(P, P .+ 1) == √3
true
Kabsch.rmsd
— Methodrmsd(::typeof(superimposed), P, Q)
Return the superimposed Root Mean Square Deviation between P and Q.
julia> using Manifolds
julia> Q = randn(3, 4);
julia> P = rand(Rotations(3)) * centered(Q) .+ randn(3);
julia> isapprox(rmsd(superimposed, Q, P), 0, atol=1e-10)
true
Kabsch.superimposed
— Methodsuperimposed(Q, P)
Returns Q superimposed on P.
julia> using Manifolds
julia> Q = randn(3, 4);
julia> P = rand(Rotations(3)) * centered(Q) .+ randn(3);
julia> superimposed(Q, P) ≈ P
true