View Single Post
  #19   Spotlight this post!  
Unread 14-12-2012, 23:28
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,565
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: numerical computation contest

Quote:
Originally Posted by DampRobot View Post
Ether,

I'm not a programmer, but I love a good geometrical challenge.

The equations I came up with were: (r-h)sin(l/2r)=x/2 and 2rsin(l/2r)=(x^2/4+h^2)^1/2
where r was the radius of the curve, h was the height specified in your diagram, l was the length of the curve, and x was the length of the chord. To find the numerical solution, input values for l and x, and solve for h or r.

Was the "challenge" to write a program that found the solutions of these functions through guess and check? Or did I come up with a different solution? Plugging in the values on this thread with my trusty graphing calculator, I got a reasonable approximation of the answers posted on this thread.
Even getting a reasonable approimation is good enough, because there is no exact answer. I simplified until I ended up with a formula that looked something like this:

sin (theta/2) = (theta * Arc) / (2 * chord length)

With theta being the angle inside the two radii that would have gone from the center of the circle to the end of the cords.

That can only be solved iteratively, graphically, or by a lookup table (for those of us who remember not having calculators....)

Once you have theta, the height is trivial.