The connection between the idea of the Good and the idea of the Triangle is that, in the physical world, there exist neither things that are perfectly good nor things that are perfect triangles. Even if you help someone, you probably do it because it gives you a pleasant feeling, or because it's just a habit, so it's not pure good. Similarly, the triangle drawn in my book is not a perfect triangle: it is ever so slightly deformed by the structure of the paper and the inaccuracy of whatever drew it.
I could say, "I have this figure here in my book that looks like it has three angles, but it's ever so slightly off; I will refer to it by describing the little quirks in its outline that come closest to its actual shape". Alternatively, I could simply say, "granted, it is an imperfect triangle; but we all know what a perfect triangle would be in theory, and it's more efficient to refer to this perfect triangle when discussing mathematics rather than this imperfect drawing in my book, so I will just call it a triangle, keeping this perfect theoretical triangle in mind". The same can be applied to a good action.
The concept of an ideal, perfect triangle or the perfect good can be helpful and efficient in our daily tasks. But Plato went farther: he held that their perfection makes them in a way divine. They are different from physical triangles and good behaviour in our daily lives; they're something of a higher order. That's why he postulated that these idea(l)s must exist in some way in a higher plane of existence, that they must transcend their imperfect physical copies.
The fact that we, humans, could in some way touch on or even comprehend these ideas must mean that we, too, must be or have been connected with the divine. For how can we have a perfect triangle in mind if we have never seen one? A being in no way connected to the divine surely could not distil a perfect triangle out of the imperfect physical things in the temporal world.