# PC modelling - connecting a cylinder to another one's barrel

Discussion in 'Gallery & Designs' started by Czestmyr, Aug 14, 2006.

1. ### CzestmyrMember

I have mentioned this in my post in the Gallery Announcements already, but it will fit here better.

I found out a formula of a function, that can be used to determine the shape of the bottom of an arbitrary-diametered cylinder, sitting on another cylinder of an arbitrary diameter. I think it can be useful to some of you. The formula states either: f1(x) = sin(acos(cos(x/r2)*r2/r1))*r1+hmin or: f2(x) = sin(acos(sin(x/r2)*r2/r1))*r1+hmin (the first one makes the seal of the smaller cylinder on the side, the second on the top of the bigger cylinder), where r1 is the diameter of the bigger cylinder, r2 the diameter of the smaller cylinder (the one, that is supposed to sit on the former), x the position on the circumferrence of the smaller cylinder and hmin is the minimal height of the second cylinder (that is, its height, measured from the peak of the first cylinder), f(x) then yields, for every point of the circumferrence at the position x, the height of the second cylinder. Thus, when you plot this function, scale the picture and trace it in a drawing program, you get exactly what you wanted: a rectangle with one side replaced by a strange-looking curve, which, when rolled and its oposing sides glued together, becomes a cylinder with a cut at one of its bases that exactly matches the curvature of the first cylinder.
If you want to mark the spot at the second cylinder, where the first one will be connected, you will also have to create a function for it. If you plot this function: f(x) = sqrt(r2^2 - (cos(x/r1)*r1)^2), where sqrt is a square root function, ^2 denotes squaring the operand, r1 is the diameter of the bigger cylinder, r2 is the diameter of the smaller cylinder and x is the point on the diameter of the bigger cylinder, you get one part of the desired curve. So just flip it vertically and you have an oval, which is the result of a projection of a circle on the barrel of a cylinder.
Hope you find these functions useful. I really hope I'm not the only maths geek in here :-D

The screenshot of an example of a plotted function can be found among my pictures in my gallery.