#### Archived

This topic is now archived and is closed to further replies.

# arc length of sin(x)

## Recommended Posts

first off, this is not a homework question, i don''t know as if its even possible I have an image which i would like to move in a sine curve, however i want its velocity to be constant. To do this i''m pretty sure i need to figure out the arc length in terms of sin(x), something like timepassedsincelastframe = 16ms; distanceneeded to travel = velocity * 16; so new x and y = ?? I have tried this on my own, however even my ti-89 calc can''t take the integral of sqrt(1+cos^2) I have tried doing various stuff on my own, such as trig substitution: cos^2(x) = tan^2(theta), or cosx = icostheta; My math teacher has no idea what to do, except of course for some type of estimation, which i know is not too hard, however it would be good to be exact. Can someone help?

##### Share on other sites
How accurate do you want it to be? Using x = t, y = sin(t) produces a curve where the velocity varies from 1 to 1.4 - not too big of a distortion.

Otherwise, you could take a bunch of samples, and use them as keyframes.

##### Share on other sites
Well, I dug around in one of my calc books and found this formula.

 int(sqrt(u^2 + a^2)du = .5 * (u * sqrt(u^2 + a^2) + a^2 * ln|u + sqrt(u^2 + a^2)|)

If we let a = 1 and u = cos(x)

Then we come up with

.5 * (cos(x) * sqrt(1 + cos^2(x) + ln|cos(x) + sqrt(1 + cos^2(x))|)

Yuck.

However The Integrator Gave me an answer of

sqrt(x + cos^2(x^3) / 3)

-Evan

500x2

---------------------------
Those who dance are considered insane by those who cannot hear the music.

Focus On: 3-D Models
Evan Pipho (evan@codershq.com)

thanks alot!!

thanks alot!!

##### Share on other sites
quote:
Original post by terminate
If we let a = 1 and u = cos(x)

Then we come up with

.5 * (cos(x) * sqrt(1 + cos^2(x) + ln|cos(x) + sqrt(1 + cos^2(x))|)

You forgot the du = -sin(x)dx bit.

Also, I'm pretty sure that integrator is wrong.

[edited by - sQuid on March 7, 2003 12:43:50 AM]

##### Share on other sites
The integrator is fine, but he must have typed something wrong. The integral is not analytic. It is a special case of the following integral, with k set to 1/2: http://mathworld.wolfram.com/EllipticIntegraloftheSecondKind.html

• ### Forum Statistics

• Total Topics
628383
• Total Posts
2982372

• 10
• 9
• 15
• 24
• 11