DiscussWorldIssues - Socio-Economic Religion and Political Uncensored Debate

DiscussWorldIssues - Socio-Economic Religion and Political Uncensored Debate (http://www.discussworldissues.com/forums/)
-   General Discussion (http://www.discussworldissues.com/forums/general-discussion/)
-   -   Trig simplification question (http://www.discussworldissues.com/forums/general-discussion/244514-trig-simplification-question.html)

Lxbsvksl 08-04-2007 08:51 PM

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.

Enfonebew 08-05-2007 03:46 AM

Quote:

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.
dont ask me, i just about passed my spreadsheets exam

Kissntell 08-05-2007 04:27 AM

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

Lxbsvksl 09-04-2007 02:14 PM

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

IRMartin 09-04-2007 05:07 PM

Quote:

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
That's the only thing I would suggest as a simplification; there's no other way to take it. You could then multiply through by YcosA to end up with (McosA + YsinA)/(YcosA - MsinA).

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.

Lxbsvksl 09-04-2007 06:23 PM

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