Kabsch
Documentation for Kabsch.
Kabsch.centered — Function
centered(P::AbstractArray{<:Number})Return the point set P centered at the origin, allowing for batch dimensions.
Kabsch.centroid — Method
centroid(P::AbstractArray{<:Number})Return the centroid of a point set P, reducing the second array dimension with Statistics.mean, allowing for batch dimensions.
Kabsch.kabsch — Method
kabsch(P, Q)Returns a rotation matrix R, and centroids of P and Q, where rmsd is minimized between a centered P, and a centered Q with rotation R applied.
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ₜ)
trueKabsch.rmsd — Method
rmsd(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
trueKabsch.rmsd — Method
rmsd(::typeof(superimposed), P, Q)Return the Root Mean Square Deviation between P and Q when superimposed on each other.
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)
trueKabsch.superimposed — Method
superimposed(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