LOGO
General Discussion Undecided where to post - do it here.

Reply to Thread New Thread
Old 08-04-2007, 08:51 PM   #1
Lxbsvksl

Join Date
Oct 2005
Posts
472
Senior Member
Default 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 There's probably a better approach to do what I'm after with but it's all a bit difficult to describe.
Lxbsvksl is offline


Old 08-05-2007, 03:46 AM   #2
Enfonebew

Join Date
Oct 2005
Posts
473
Senior Member
Default
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 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
Enfonebew is offline


Old 08-05-2007, 04:27 AM   #3
Kissntell

Join Date
Oct 2005
Posts
576
Senior Member
Default
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
Kissntell is offline


Old 09-04-2007, 02:14 PM   #4
Lxbsvksl

Join Date
Oct 2005
Posts
472
Senior Member
Default
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
Lxbsvksl is offline


Old 09-04-2007, 05:07 PM   #5
IRMartin

Join Date
Oct 2005
Posts
378
Senior Member
Default
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
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.
IRMartin is offline


Old 09-04-2007, 06:23 PM   #6
Lxbsvksl

Join Date
Oct 2005
Posts
472
Senior Member
Default
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 ()
Lxbsvksl is offline



Reply to Thread New Thread

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

All times are GMT +1. The time now is 10:14 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 PL2
Design & Developed by Amodity.com
Copyright© Amodity