Hi,

I'm trying to program an outer point labelling system for pentagrams and I'm having trouble with the logic.

I have 5 pairs of outer x & y coordinates

I have 5 pairs of inner x & y coordinates

I have decided that point "A" is the outer x & y coordinate pair that has an x value closest to the x value of the center of the inner pentagon. That's easy. The center just being the average of the 5 inner pairs.

I would like the outer points to be labelled clockwise, B, C, D & E.

What logic can I use to determine which point is which?

Any help is appreciated.

Thanks