Jeff;
Here is a portion of code I use in arx, that might give you the idea, what I do is to sort the points by the x value, and after that, I just grab the pair of points with the center like:
vector <int>::size_type lth;
lth = _points.size();
int cont = 0;
while (cont < (lth - 1)) {
AcGePoint3d p0 = _points.at(cont);
AcGePoint3d p1 = _points.at(1+cont);
if (!doubleEq(acutDistance(asDblArray(p0),asDblArray(p1)),0.0)) {
double sang = acutAngle(asDblArray(ctr),asDblArray(p0));
double eang = acutAngle(asDblArray(ctr),asDblArray(p1));
double sa,ea;
if (sang < eang) {
sa = sang;
ea = eang;
}else {
sa = eang;
ea = sang;
}
AcDbArc *pNewArc = new AcDbArc(ctr,rad,sa,ea);
AcDbObjectId curSpaceId = acdbCurDwg()->currentSpaceId();
AcDbBlockTableRecord *pBlkRec = NULL;
if (acdbOpenObject(pBlkRec,curSpaceId,AcDb::kForWrite) == Acad::eOk) {
pBlkRec->appendAcDbEntity(pNewArc);
pBlkRec->close();
pNewArc->close();
}
}
cont = (1 + cont);
}
HTH