prolate cycloid body movement

How can I make a box2d body move along a prolate cycloid curve? The parametric equations are
x = at-bsint
y = a-bcost where a is the radius and a and b are constants.

I am not sure how to use these equations to get the movement. I've searched extensively and haven't found anything leads. Please check the following link to see how the curve looks (http://mathworld.wolfram.com/ProlateCycloidEvolute.html). I would appreciate any help.
I suppose you pick whatever values for a, b, radius that you want, and then gradually change t to get the x and y positions along the curve. Then you can either set the body position with SetTransform, or SetLinearVelocity to make it move towards the x,y that was calculated.
Thanks for the help. I found some other equations for the prolate cycloid which I am using from (http://cuhkmath.wordpress.com/2011/07/2 ... curvature/).

x = at + bCost
y = bSint

Since y is bSint it should move from -b to b, but that doesn't happen. The prolate cycloid movement at the beginning works for the first two turns then it moves a bit like a sin curve with y (it's range) reducing as x increases. I don't know what is causing this.
gamist wrote:x = at + bCost
y = bSint

hmm.... but the page you linked to says:
x = t + 2Cost
y = 2Sint

Just to check that we're on the same page, to put that in code you would have something like this right?

Code: Select all

b2Vec2 prolateCycloid( float t ) {
    return b2Vec2( t + 2 * cosf(t), 2 * sinf(t) );
}

To stretch it horizontally or vertically you could then multiply each component by something:

Code: Select all

b2Vec curvePoint = prolateCycloid( ... );
curvePoint.x *= a;
curvePoint.y *= b;
Sorry, this is not as simple as I thought. 😮 I also noticed that the link you gave in your first post is for the 'evolute' of the curve (the red line in the graph on that page), so it's probably not the one you want. I think this is the one you want: http://mathworld.wolfram.com/ProlateCycloid.html
So that would be:

Code: Select all

b2Vec2 prolateCycloid( float t, float a, float b ) {
    return b2Vec2( a * t - b * sinf(t), a - b * cosf(t) );
}
It's working after increases the b value considerably. Actually the prolate I want is like (http://www.dmcinfo.com/Latest-Thinking/ ... Loops.aspx). I mainly want the loops to be smaller, I've been trying values but I am not getting it the loops as small as I want. I also realized that the loops reduce as they move along the x-axis. I don't know what causes that.

Original thread: https://box2d.org/forum/viewtopic.php?t=9287