![]() |
Trig simplification question
I'm currently writing an OpenGL app and I'm wondering if I can simplify this bit of trig I use to manipulate the camera:
D = Y*tan(atan(M/Y) + A) - M I haven't done any proper maths in a while so I'm a bit rusty http://discussworldissues.com/forums...ies/blush1.gif There's probably a better approach to do what I'm after with but it's all a bit difficult to describe. |
Quote:
|
There are some trig idenities that you can use to simplify it. I know tan = sin/cos. And arctan is equal to something, just can't rememer, but you could probably simplify it that way.
These might be of help http://library.thinkquest.org/17119/...ize/basic.html http://en.wikipedia.org/wiki/Arctangent |
I was thinking along the lines of getting rid of that atan within tan business, closest thing I've found is the formula:
tan(A+B)=(tan(A)+tan(B))/(1-tan(A)tan(B)) While it does get rid of the atan, it also makes the whole thing a lot bigger [no] edit: Well I'll be going home in a couple of days anyway so I guess I can just ask my TI-89 Ti http://discussworldissues.com/forums...ies/smile1.gif |
Quote:
It might be more efficient to perform that manipulation and not have an arctan calculation? I know that languages I've used in the past run much more quickly using sin and cos functions. |
Cool, I'll check out the differences between atan+tan, 2xtan and 2xsin+2xcos after the rush to get something out the door for the demonstration we need to give on it next week (http://discussworldissues.com/forums...s/excited1.gif)
|
All times are GMT +1. The time now is 12:29 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2