Created
October 6, 2019 11:01
-
-
Save MrTelanie/45b18d9927f89921cd20751e098cc9e8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 */ | |
| export function fromOrientation({ alpha, beta, gamma }, orientation) { | |
| let rot = iquaternion(UP, degree(alpha)) | |
| .mul(RIGHT, degree(beta)) | |
| .mul(FORWARD, degree(gamma)) | |
| .mul(LEFT90); | |
| rot = iquaternion(rot.dir, degree(orientation)) | |
| .mul(rot); | |
| return rot; | |
| } | |
| /* curry */ | |
| const multiply = makeCurry( | |
| (one, two) => one.multiply(two), | |
| IQuaternion | |
| ); | |
| export function fromOrientation({ alpha, beta, gamma }, orientation) { | |
| const rot = multiply(UP, degree(alpha)) | |
| (RIGHT, degree(beta)) | |
| (FORWARD, degree(gamma)) | |
| (LEFT90); | |
| return multiply(rot.dir, degree(orientation)) | |
| (rot); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment