-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved inertia alignment method and improved documentation (#122)
* Added better readme and --help information. * Updated the Inertia Hungarian alignment method to align with all three Inertia axes, not just the principal. * Set it as the default reordering method to inertia-hungarian. * Change some CLI arguments to be more consistent with standard practice (remove double letter, single dash arguments). Co-authored-by: hagenmuenkler <[email protected]>
- Loading branch information
1 parent
b498c91
commit 21cc9af
Showing
36 changed files
with
1,067 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.vim | ||
env | ||
*.sqlite3 | ||
*.ipynb_checkpoints | ||
|
||
*.py[cod] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import numpy as np | ||
from numpy import ndarray | ||
|
||
|
||
def get_rotation_matrix(degrees: float) -> ndarray: | ||
"""https://en.wikipedia.org/wiki/Rotation_matrix""" | ||
|
||
radians = degrees * np.pi / 180.0 | ||
|
||
r11 = np.cos(radians) | ||
r12 = -np.sin(radians) | ||
r21 = np.sin(radians) | ||
r22 = np.cos(radians) | ||
|
||
R = np.array([[r11, r12], [r21, r22]]) | ||
|
||
return R | ||
|
||
|
||
def degree2radiant(degrees): | ||
return degrees * np.pi / 180.0 | ||
|
||
|
||
def rotate_coord(angle, coord, axis=[0, 1]): | ||
U = get_rotation_matrix(angle) | ||
_xy = np.dot(coord[:, axis], U) | ||
_coord = np.array(coord, copy=True) | ||
_coord[:, axis] = _xy | ||
return _coord |
Oops, something went wrong.