Solution to a maths problem sought.

Discuss the language of the universe.

Moderators: kiore, Blip, The_Metatron

Solution to a maths problem sought.

#1  Postby CookieJon » Mar 21, 2012 10:25 am

Hi all,

I understand from wikipedia that to derive the time taken to go from one velocity (u) to another (v) over a specified distance (s) with a constant acceleration, the formula is:

t = s/((u+v)/2) ... is that right to start with?

But how do I determine the time it will take for an object to rotate a certain amount, if the initial and final speeds of rotation, and the total distance to rotate are each specified as sets of 3 angles (around the x,y & z axes)?

Does that question even make sense?

Any clues appreciated.
User avatar
CookieJon
RS Donator
THREAD STARTER
 
Posts: 8384
Male

Jolly Roger (arr)
Print view this post

Re: Solution to a maths problem sought.

#2  Postby Corke » Mar 21, 2012 4:24 pm

I think it would be helpful to think in terms of vectors here. Imagine you have a ball, that wherever it rolled, it left a black line. When it rolls through an angle of 360 degrees, or 2 pi, it leaves a line equal to the circumference. It can thus roll in three planes. Doesn't matter if you have an irregular object, imagine a ball at the centre.

Now you can use vectors to find the total distance rolled and the initial and final speeds. You can convert the angles into distances easily if you imagine the circumference to be 1/2pi or something easy. I don't know if you should then find the modulus of each and use your formula, or try to resolve these vectors somehow, but something should work. I hope.

May I ask what this is for?
User avatar
Corke
 
Posts: 1561
Age: 29
Male

South Africa (za)
Print view this post

Re: Solution to a maths problem sought.

#3  Postby Pulsar » Mar 21, 2012 4:53 pm

CookieJon wrote:Hi all,

I understand from wikipedia that to derive the time taken to go from one velocity (u) to another (v) over a specified distance (s) with a constant acceleration, the formula is:

t = s/((u+v)/2) ... is that right to start with?

Yes, that looks right. The formulae are

[math]

so that

[math]

CookieJon wrote:
But how do I determine the time it will take for an object to rotate a certain amount, if the initial and final speeds of rotation, and the total distance to rotate are each specified as sets of 3 angles (around the x,y & z axes)?

Does that question even make sense?

If you want to rotate an object around 3 angles, you should use Euler angles or something similar. Is this what you want?
"The longer I live the more I see that I am never wrong about anything, and that all the pains that I have so humbly taken to verify my notions have only wasted my time." - George Bernard Shaw
User avatar
Pulsar
 
Posts: 4618
Age: 46
Male

Country: Belgium
Belgium (be)
Print view this post

Re: Solution to a maths problem sought.

#4  Postby epepke » Mar 21, 2012 5:27 pm

CookieJon wrote:But how do I determine the time it will take for an object to rotate a certain amount, if the initial and final speeds of rotation, and the total distance to rotate are each specified as sets of 3 angles (around the x,y & z axes)?

Does that question even make sense?


Euler angles are icky, and you get gimbal lock. Better to convert the Euler angles for each orientation to a unit quaternion. The rotational "distance" is just the geodesic on a 3-sphere between the two orientations. Plus, it's the optimal rotation.
User avatar
epepke
 
Posts: 4080

Country: US
United States (us)
Print view this post

Re: Solution to a maths problem sought.

#5  Postby CookieJon » Mar 22, 2012 10:12 am

Thanks for the responses, but I'm still no closer.

Corke wrote:May I ask what this is for?


Yes; a computer game.

Perhaps I'm asking the wrong question... here's what I'm trying to achieve:

I have an object rotating at a constant speed.

I would like the rotating object to stop rotating by slowing down from its current speed to 0 over a given (angular) distance.

I have a function to rotate an object by a specified distance over a specified duration, achieved by interpolating between the start and end angles over time, and applying an easing function to simulate accelerate/decelerate from zero.

The problem is that by specifying the time, I have no idea what the speed will be. So I need a similar function, but instead of specifying the angle, time & an easing function, I want to specify the angle, start & end speeds so that I can match the object's current speed (so it's smooth), and I have no idea how to achieve that.

Does that make sense?
User avatar
CookieJon
RS Donator
THREAD STARTER
 
Posts: 8384
Male

Jolly Roger (arr)
Print view this post

Re: Solution to a maths problem sought.

#6  Postby Corke » Mar 22, 2012 3:13 pm

Sounds like a pretty fun game :D

Is this object stationary or rolling? Also, are you rotating it in one dimension i.e. using one angle, or are there more angles involved?

Can you express your angle velocities like so: pi/4 radians per second?
User avatar
Corke
 
Posts: 1561
Age: 29
Male

South Africa (za)
Print view this post

Re: Solution to a maths problem sought.

#7  Postby CarlPierce » Mar 27, 2012 11:23 pm

If the initial rate of rotation is X radians / sec and the body slows down at a constant angular rate to rest in time T seconds.
then the total amount of rotation will be XT / 2 radians.

If the initial rate of rotation is X rad/sec and the final rate of rotation is Y rad/sec and the objects spin change over time T
then the total amount of rotation is (X + Y)T / 2 radians.

Its that simple isn't it ?
User avatar
CarlPierce
RS Donator
 
Posts: 4105
Age: 59
Male

United Kingdom (uk)
Print view this post

Re: Solution to a maths problem sought.

#8  Postby Calilasseia » Mar 28, 2012 12:21 am

Basically, most Newtonian formulae for linear speed and acceleration work when you replace the quantities with angular speed and acceleration.
Signature temporarily on hold until I can find a reliable image host ...
User avatar
Calilasseia
RS Donator
 
Posts: 22632
Age: 62
Male

Country: England
United Kingdom (uk)
Print view this post

Re: Solution to a maths problem sought.

#9  Postby CookieJon » Mar 28, 2012 1:15 pm

Hi,

Thanks for the advice all. The problem I was having was in thinking of it as 3 separate angles of rotation.

I eventually solved the problem by converting the euler angles to a quaternion, which provides a single angle of rotation around an axis, from which I was able to derive the required values using the SUVAT formula for constant acceleration.

Too easy (in hindsight!)
User avatar
CookieJon
RS Donator
THREAD STARTER
 
Posts: 8384
Male

Jolly Roger (arr)
Print view this post


Return to Mathematics

Who is online

Users viewing this topic: No registered users and 1 guest