
Trigonometry help
Help! I've never learn trigonometry!
I have two circles and need to make tangent lines conecting both.
This is probably a basiq question but I just cant find how!

Senior Member
Conveyor Belt Trigonometry
http://spacegrape.com/flashkit/conveyor.html
// I only got one 'side' of the conveyor belt so far and it is flawed somehow
// a large wheel close to a small one and it gets funky
// interesting problem
//a,b center of the first circle
//c,d center of the second circle
//x1,y1 'top' tangent point on the first circle
//x2,y2 'top' tangent point on the second circle
//g angle between segment ab_cd and ab_x1y1
//g is also the angle between ab_cd and cd_x2y2
//h is not shown in the diagram, it is the angle between ab_cd and horizon
//dist=distance between the two centers
dist = Math.sqrt((c*ca*a)+(d*db*b));
g = Math.acos((r1r2)/dist);
h = Math.atan((bd)/(ca));
// 'top' of belt
x1 =Number(a)+Number(Math.round(1000*r1*Math.cos(gh))/1000);
y1 =Number(b)+Number(Math.round(1000*r1*Math.sin(gh))/1000);
x2 = Number(c)+Number(Math.round(1000*r2*Math.cos(gh))/1000);
y2 = Number(d)+Number(Math.round(1000*r2*Math.sin(gh))/1000);
Last edited by ironmallet; 12232008 at 02:13 AM.
Reason: fla

Ah, this is some tasty math. I will do a quick review of my discreet and then post back with some formulas

you will need an if statement something like this
if circle1.radius>circle2.radius
elseif circle1.radius>circle2.radius
else *(circle1.radius=circle2.radius)*{
the code you currently have will fit here
}
I will explain my math if you need help but it is pretty complicated so I will save you the confusion for now
note:you must reverse circle 1 and 2 for the second if statement
if circle1.radius>circle2.radius {
dist=Math.sqrt((circle1._xcircle2._x)*(circle1._xcircle2._x)+(circle1._ycircle2.y)*(circle1._ycircle2._y))
n=dist*circle2.radius/circle1.radius
offsetangle = Math.asin(circle1.radius/(dist+n))
}
now the offsetangle is the angle, in radians, you must add to the top and subtract from the bottom of both circles in order to get the correct tangent.
Although, I could be wrong, you might have to subtract from the top and add to the bottom.
Last edited by nichaey; 01032009 at 05:40 PM.
Reason: Dang Dirty Apes
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

Click Here to Expand Forum to Full Width
