Kabsch

Documentation for Kabsch.

Kabsch.centeredFunction
centered(P::AbstractArray{<:Number})

Return the point set P centered at the origin, allowing for batch dimensions.

source
Kabsch.centroidMethod
centroid(P::AbstractArray{<:Number})

Return the centroid of a point set P, reducing the second array dimension with Statistics.mean, allowing for batch dimensions.

source
Kabsch.kabschMethod
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ₜ)
true
source
Kabsch.rmsdMethod
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
true
source
Kabsch.rmsdMethod
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)
true
source
Kabsch.superimposedMethod
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
source