Created
April 9, 2018 09:11
-
-
Save chenyong/a7182016127c23441df29e0a5f759829 to your computer and use it in GitHub Desktop.
Some math to explore 3D rotation, find the center point of the orbit.
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
| axie = k1 * (x*i + y*j + z*k) | |
| point = a*i + b*j + c*k | |
| distance = (k1*x - a)*i + (k1*y - b)*j + (k1*z - c)*k | |
| 0 = axie * distance = k1 * (x*i + y*j + z*k) * ((k1*x - a)*i + (k1*y - b)*i + (k1*z - c)k) | |
| 0 = (x*i + y*j + z*k) * ((k1*x - a)*i + (k1*y - b)*i + (k1*z - c)k) | |
| = (x*i) * ((k1*x - a)*i + (k1*y - b)*j + (k1*z - c)k) | |
| + y*j * ((k1*x - a)*i + (k1*y - b)*j + (k1*z - c)k) | |
| + z*k * ((k1*x - a)*i + (k1*y - b)*j + (k1*z - c)k) | |
| = ((k1*x - a)*x*i + (k1*y - b)*x*j + (k1*z - c)*x*k)i | |
| + ((k1*x - a)*y*i + (k1*y - b)*y*j + (k1*z - c)*y*k)j | |
| + ((k1*x - a)*z*i + (k1*y - b)*z*j + (k1*z - c)*z*k)k | |
| = (-(k1*x - a)*x - (k1*y - b)*x*k + (k1*z - c)*x*j) | |
| + ((k1*x - a)*y*k - (k1*y - b)*y - (k1*z - c)*y*i) | |
| + (-(k1*x - a)*z*j + (k1*y - b)*z*i - (k1*z - c)*z) | |
| = - (k1*x - a)*x - (k1*y - b)*y - (k1*z - c)*z | |
| + (k1*y - b)*z*i - (k1*z - c)*y*i | |
| + (k1*z - c)*x*j - (k1*x - a)*z*j | |
| + (k1*x - a)*y*k - (k1*y - b)*x*k | |
| 0 = - (k1*x - a)*x - (k1*y - b)*y - (k1*z - c)*z | |
| = - k1*x^2 + a*x - k1*y^2 + b*y - k1*z^2 + c*z | |
| = k1(- x^2 - y^2 - z^2) + a*x + b*y + c*z | |
| k1 = (a*x + b*y + c*z)/(x^2 + y^2 + z^2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment