I wrote some code a while back to find the tangent of an angle, but now I'm not sure how it works, can someone help me figure it out again? haha
The mathematical formula is this: \[\Large \tan \theta = \frac{\sqrt{x^2+y^2}}{z}\] The reason I say it's code is because x, y, and z are all different values on the phone based on this picture http://www.larsivar.com/cp/images/android_AccForces.png and the angle is the angle between gravity and the normal vector to the face of the phone |dw:1424125344953:dw|
Here's a better picture of what I'm describing |dw:1424125451340:dw| So if you lay the phone straight down you have theta = 0, tangent =0 since z axis on the phone is parallel to the gravity vector (the only vector independent of the phone)
Join our real-time social learning platform and learn together with your friends!