math problem: help me figure this out. (now with paypal reward)

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

notfred

Lifer
Feb 12, 2001
38,241
4
0
Here's the semi functional script

NOTE: This works in Firefox 1.5+ ONLY!

Try setting "number of teeth on cog" to something small (maybe 10) and "number of teeth on chainring" to something large (try 150), and you'll see the appropriate lines drawn in the diagram below.
 

chuckywang

Lifer
Jan 12, 2004
20,133
1
0
Originally posted by: notfred
Originally posted by: chuckywang
Originally posted by: MathMan
Ok, it can be simplified a bit more...


sin (theta + pi/2) = cos (theta), and
cos (theta + pi/2) = sin (theta), so

U = x * sin(theta), x * cos(theta)
V = d + y * sin(theta), y * cos(theta)

But sin(theta) = (y-x)/d, and cos(theta) = sqrt(1 - (y-x)^2 / d^2)), so we have

U = x * (y-x)/d , x * sqrt(1 - (y-x)^2 / d^2))
V = d + y * (y-x)/d, y * sqrt(1 - (y-x)^2 / 2^2))

cos(theta + pi/2) = -sin(theta)

BTW, your solution works. If you want $5, PM me a paypal address :) I'll post a link to the semi-functional script in a few :)

Sweet, thanks!
 

Martin

Lifer
Jan 15, 2000
29,178
1
81
Originally posted by: notfred
Originally posted by: chuckywang
Originally posted by: MathMan
Ok, it can be simplified a bit more...


sin (theta + pi/2) = cos (theta), and
cos (theta + pi/2) = sin (theta), so

U = x * sin(theta), x * cos(theta)
V = d + y * sin(theta), y * cos(theta)

But sin(theta) = (y-x)/d, and cos(theta) = sqrt(1 - (y-x)^2 / d^2)), so we have

U = x * (y-x)/d , x * sqrt(1 - (y-x)^2 / d^2))
V = d + y * (y-x)/d, y * sqrt(1 - (y-x)^2 / 2^2))

cos(theta + pi/2) = -sin(theta)

BTW, your solution works. If you want $5, PM me a paypal address :) I'll post a link to the semi-functional script in a few :)

I'd be interested in seeing it. I've been doing increasing amounts of javascript at work, and I must say can be quite interesting...
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: Martin
Originally posted by: notfred
Originally posted by: chuckywang
Originally posted by: MathMan
Ok, it can be simplified a bit more...


sin (theta + pi/2) = cos (theta), and
cos (theta + pi/2) = sin (theta), so

U = x * sin(theta), x * cos(theta)
V = d + y * sin(theta), y * cos(theta)

But sin(theta) = (y-x)/d, and cos(theta) = sqrt(1 - (y-x)^2 / d^2)), so we have

U = x * (y-x)/d , x * sqrt(1 - (y-x)^2 / d^2))
V = d + y * (y-x)/d, y * sqrt(1 - (y-x)^2 / 2^2))

cos(theta + pi/2) = -sin(theta)

BTW, your solution works. If you want $5, PM me a paypal address :) I'll post a link to the semi-functional script in a few :)

I'd be interested in seeing it. I've been doing increasing amounts of javascript at work, and I must say can be quite interesting...

Two posts above yours ;)
 

Koing

Elite Member <br> Super Moderator<br> Health and F
Oct 11, 2000
16,843
2
0
ATOT comes up trumps again :thumbsup:

Koing
 

Pepsei

Lifer
Dec 14, 2001
12,895
1
0
wow, the differences between this and the other guy that Loke turned in is night and day.

i guess it's the way you have to present your request, and the fact that we always enjoy notfred's writing in the past.

 

Koing

Elite Member <br> Super Moderator<br> Health and F
Oct 11, 2000
16,843
2
0
Originally posted by: Pepsei
wow, the differences between this and the other guy that Loke turned in is night and day.

i guess it's the way you have to present your request, and the fact that we always enjoy notfred's writing in the past.

What happened with the other guy?

Koing
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: Pepsei
wow, the differences between this and the other guy that Loke turned in is night and day.

i guess it's the way you have to present your request, and the fact that we always enjoy notfred's writing in the past.

Yeah, he was trying to get other people to do his homework, and I wasn't.
 

linkgoron

Platinum Member
Mar 9, 2005
2,598
1,238
136
err maybe I'm an idiot but cant you you two simple equations, without sin and anything and get it done?
A=radius (left circle)
B=radius (right circle)
using y=mx (that line that connects both circles)
left circle being x^2+y^2=A^2
right circle (x-d)^2+y^2=B^2
and that line Y-MX=0

EDIT 1:
it's kind of complicated, but it's a 5 line answer, I think at least:p
you use distance between two err dots? (don't know terms in English lol) (0,0) and the left circle's resting(?) (using the sqrt((x1-x2)^2+sqrt(y1-y2))=Distance) and another equastion using the right circle and using this:
|D*M|/SQRT(2) = B

EDIT2:
Well It works, or should work, and I get what you wanted, but it seems you found an answer so NM...
 

Pepsei

Lifer
Dec 14, 2001
12,895
1
0
Originally posted by: Koing
Originally posted by: Pepsei
wow, the differences between this and the other guy that Loke turned in is night and day.

i guess it's the way you have to present your request, and the fact that we always enjoy notfred's writing in the past.

What happened with the other guy?

Koing

i think loke found out where he goes to school and send the link of the thread to the school dean.