Math::Vector::BestRotationBest rotation to match two vector sets | |
Download |
Math::Vector::BestRotation Ranking & Summary
Advertisement
- License:
- GPL
- Publisher Name:
- Lutz Gehlen
- Publisher web site:
- http://search.cpan.org/~lgehlen/
Math::Vector::BestRotation Tags
Math::Vector::BestRotation Description
Best rotation to match two vector sets Assume that you have a list of vectors v_1, v_2, v_3, ..., v_n and an equally sized list of vectors w_1, w_2, ..., w_n. A way to quantify how similar these lists are to each other is to compute the sum of the squared distances between the vectors: sum((w_1 - v_1)**2 + ... + (w_n - v_n)**2). In the literature, this sum is sometimes divided by 2 or divided by n or divided by n and the square root is taken ("root mean square" or RMS deviation).In some situations, one data set can be arbitrarily rotated with respect to the other one. In this case, one of them has to be rotated in order to calculate the RMS deviation in a meaningful way. Math::Vector::BestRotation is a Perl module that solves this problem. It calculates the best orthogonal map U between the v_i and w_i. "Best" means here that the RMS deviation between Uv and w as calculated above is minimized.An orthogonal map can be a (proper) rotation or a rotation combined with a reflection (improper rotation). This module enables you to find the best orthogonal map, the best proper rotation, or the best improper rotation between two given vector sets.SYNOPSIS use Math::Vector::BestRotation; my $best = Math::Vector::BestRotation->new(); $best->add_pair(, ); $best->add_pair(, ); . . . $best->add_pair(, ); my $ortho = $best->best_orthogonal; my $rot = $best->best_rotation; my $flip = $best->best_improper_rotation; my $axis = $best->rotation_axis; my $angle = $best->rotation_angle; # start over $best->clear; Requirements: · Perl
Math::Vector::BestRotation Related Software