What is the shortest line around two equally sized circles called? Like the outline of a rectangle with semi-circular ends. Is there a formula to describe it(like $x^2 + y^2 = r^2$ describes a circle)? 
I'm sure I could Google it if I knew a name for this shape - surely something this simple must have a name?
The circles can be separate, touching, intersecting or co-incident(one circle). They will always be the same size
I need to be able to determine the co-ordinates of the intersection of the shape and a straight line at any given angle to the horizontal from the centre of the shape to the edge. 
say $r=radius$ and $d=$distance between centres
For a specified $r$ and $d$ and $\angle$ from any point$(x, y)$ on the edge to midway between the centres to the horizontal. I need to find $(x, y)$ 
Apologies for my non-mathematical statement of the problem.
I was good at maths $20$ years ago!
 A: This type of curve is known as a stadium: http://mathworld.wolfram.com/Stadium.html
A: There isn't an analytic function of $x$ and $y$ whose zero-set is this curve: you would need a function defined piecewise.  And to get the coordinates of your point in the last part of your question you'll want to look at cases (the point is on one semicircle, or the other, or one of the straight lines).
A: Some people call this curve a "racetrack", especially in engineering.
You can fake an "analytic" equation. Let $L$ be the line segment between the two circle centers, and let $r$ be the radius of the circles. Then the curve has equation
$$ d(\mathbf x, L) = r$$
where $d$ denotes the usual distance function. This technique makes the curve look tidy and "analytic" and hides its piecewise nature. Good for writing papers, maybe, but not much else. To do any computations, you'll still have to go back to the piecewise form (two lines and two semi-circles).
Even tidier ... if $B$ is the unit ball in $\mathbb R^2$ then the racetrack set is $L + rB$. Actually, in this form, it might be useful for doing calculations, since quite a lot is known about how to compute with Minkowski sums. Probably not much use to the OP, but might be interesting to more erudite readers.
Regarding line intersections ...
Suppose the racetrack is positioned with its center at the origin. The top line is $y=r$, the bottom line is $y=-r$, and the right-hand end is the circle with equation $(x-h)^2 + y^2 = r^2$. Here, $h$ is the "half-width" of the racetrack, between centers, so that the distance between the two semi-circle centers is $2h$.
Now, suppose we take a line through the center that has an angle $\theta$ with the $x$-axis, where $\theta \ge 0$. This line has equation $y = mx$, where $m = \tan\theta$. It intersects the top edge of the racetrack when $y=r$, and this happens when $x = r/m$. But this calculation is only valid if $r/m \le h$, i.e. if $\tan\theta \ge r/h$. On the other hand, if $\tan\theta < r/h$, then the angled line intersects the ends of the racetrack (the semi-circles). To find the $x$-coordinate of the right-hand intersection, we have to find the larger of the two solutions of the equation $(x-h)^2+(mx)^2=r^2$. After doing that, we find the corresponding $y$-value from the equation $y=mx$.
