I've been looking into the fundemental properties of Euler angles, and found this helpful article. The article provided a handful of useful equations and functions, though it lacked any explanation. For example, it describes a situation where only one axis (from 0 to 360 deg.) is needed, and provides the method/solution:
local direction = part1.CFrame.lookVector local heading = math.atan2(direction.x, direction.z) heading = math.deg(heading)
Though no explanation was provided in any way that described the math behind it.
Reference notes were given at the end of the article, which was somewhat helpful, as follows:
local sx, sy, sz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = matrix:components() -- m12 = ?cos Y sin X -- m22 = cos X cos Y -- => -m12 / m22 = sin X / cos X ]] local X = math.atan2(-m12, m22) -- m02 = sin Y local Y = math.asin(m02) -- m01 = ?cos Y sin Z -- m00 = cos Y cos Z -- => -m01 / m00 = sin X / cos X ]] local Z = math.atan2(-m01, m00)
Though again, there was no explanation given. Any links to videos, articles, etc. that explain euler angles, even if it doesn't involve Roblox CFrames, would be great. Thanks in advance!
Explanation on Radians: https://www.youtube.com/watch?v=HACNCy0clO0
Roblox examples: http://wiki.roblox.com/index.php?title=Euler_angles
png examples: http://wiki.roblox.com/index.php?title=File:Euler_angles.png