Comments and answers for "Calculating an angle to rotate some tangent around an axis"
http://answers.unity.com/questions/934403/calculating-an-angle-to-rotate-some-tangent-around.html
The latest comments and answers for the question "Calculating an angle to rotate some tangent around an axis"Comment by saporter on saporter's answer
http://answers.unity.com/comments/939945/view.html
Fri, 03 Apr 2015 23:59:26 GMTsaporterComment by Glurth on Glurth's answer
http://answers.unity.com/comments/939919/view.html
Fri, 03 Apr 2015 22:57:15 GMTGlurthComment by nikich0601 on nikich0601's answer
http://answers.unity.com/comments/937725/view.html
Wed, 01 Apr 2015 12:34:45 GMTnikich0601Comment by Glurth on Glurth's answer
http://answers.unity.com/comments/936211/view.html
Mon, 30 Mar 2015 15:34:21 GMTGlurthComment by saporter on saporter's answer
http://answers.unity.com/comments/936176/view.html
Mon, 30 Mar 2015 14:42:21 GMTsaporterComment by Glurth
http://answers.unity.com/comments/935782/view.html
Mon, 30 Mar 2015 03:37:22 GMTGlurthComment by saporter
http://answers.unity.com/comments/935744/view.html
Mon, 30 Mar 2015 01:29:37 GMTsaporterAnswer by Glurth
http://answers.unity.com/answers/935751/view.html
Ah, that clears t$$anonymous$$ngs up a bit!
![alt text][1]
consider the grey triangle: if we can solve for that bottom angle we can simply use angle addition/subtraction to get how far to rotate.
For the grey triangle we have:
the leftmost side has length of (target-center).magnitude
the lower right side has length of the (gunsposition-center).magnitude
we also have one angle for the triangle, a constant variation on the FOF angle: 180-(FOF/2)
With t$$anonymous$$s information we should be able to solve the triangle completely.
http://www.mathsisfun.com/algebra/trig-solving-ssa-triangles.html
You should only need the first step though, using the law of sines:
I got...
TopAngle = ArcSin( Sin(180-FOF/2)*(gun-center).magnitude/(target-center).magnitude )
BottomAngle = 180-(TopAngle+(180-FoF/2)); //angles add up to 180 for triangles
[1]: /storage/temp/43853-question-diag.pngSun, 29 Mar 2015 20:06:33 GMTGlurthComment by saporter
http://answers.unity.com/comments/935542/view.html
Sun, 29 Mar 2015 18:35:32 GMTsaporterComment by Glurth
http://answers.unity.com/comments/935033/view.html
Sun, 29 Mar 2015 00:24:36 GMTGlurthComment by saporter
http://answers.unity.com/comments/934912/view.html
Sat, 28 Mar 2015 19:38:09 GMTsaporterComment by Glurth
http://answers.unity.com/comments/934862/view.html
Sat, 28 Mar 2015 18:25:04 GMTGlurthComment by saporter
http://answers.unity.com/comments/934727/view.html
Sat, 28 Mar 2015 15:22:52 GMTsaporterComment by lordlycastle
http://answers.unity.com/comments/934706/view.html
Sat, 28 Mar 2015 14:55:54 GMTlordlycastleComment by Glurth
http://answers.unity.com/comments/934705/view.html
Sat, 28 Mar 2015 14:52:25 GMTGlurthComment by saporter
http://answers.unity.com/comments/934700/view.html
Sat, 28 Mar 2015 14:41:48 GMTsaporterComment by Glurth
http://answers.unity.com/comments/934673/view.html
Sat, 28 Mar 2015 13:42:01 GMTGlurth