Created
September 25, 2020 16:27
-
-
Save MCarlomagno/f8b13aca514f0b0c3b030f38940dfa4d 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
// right and left wrists are the objects given by the model | |
const rx = rightWrist.position.x; | |
const ry = rightWrist.position.y; | |
const lx = leftWrist.position.x; | |
const ly = leftWrist.position.y; | |
// vertical and horizontal distance | |
var dy = ly - ry; | |
var dx = lx - rx; | |
var theta = Math.atan2(dy, dx); // range (-PI, PI] | |
alpha *= -180 / Math.PI; // rads to degs, range (-180, 180] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment