Help simplifying a really long expression: (cos(A+(R*1))*(V+

kernowboy

New member
Joined
Apr 8, 2009
Messages
7
Sorry if this post is in the wrong section, or has been answered elsewhere already - I really don't know what to search for.
It's not homework or anything like that - it's for a game I'm trying to make.

Anyway, I have this really long formula that starts like this:

(Cos(A+(R*1))*(V+(T*1))) + (Cos(A+(R*2))*(V+(T*2))) + (Cos(A+(R*3))*(V+(T*3))) + (Cos(A+(R*4))*(V+(T*4)))....

and continues all the way up to ....(Cos(A+(R*50))*(V+(T*50)))

My question is, can this be simplified somehow?

Any help at all will be much appreciated :)
(please assume I know very little maths)
 
Re: Help simplifying a really long expression

If you know "very little maths", HOW did you come up with that monstrosity ? :shock:

(Cos(A+(R*1))*(V+(T*1)))
Nice to use ample brackets, but hard to make out when too many are used!
I make that to be: COS( A + R*1) * (V + T*1) ; is that your intent?

If you're "making a game", then it's really a computer program, right?
So why not simply use a loop; letting N = 1 to 50:

SUM = 0
Loop N from 1 to 50
SUM = SUM + COS( A + R*N) * (V + T*N)
Endloop

Anyhoo, I see no way to simplify your expression; doubt if anybody else will.
 
Re: Help simplifying a really long expression

You understand correctly.
I am currently using a loop, like you suggest, but because I'm not using a proper programming language it's *very* slow.
I was just hoping there might be way to make a simpler expression, containing a variable to represent how many times it should loop (ie. 50 in this case).
Sounds like I'm out of luck though :(

It's actually only a very simple little formula for moving an object with constant rates of acceleration & turning (at least that's what it's meant to do).
My actual problem is with moving an object as close as possible to a set destination (in a fixed time period), but with constraints on acceleration and rate of turning. The only way I've been able to come up with, is effectively trial and error - tetsing many many combinations of turning and acceleration.

Thanks very much for taking the time to try and help though.
 
Top