Draw 3D arc given start, middle, and endpoint
===

I am trying to make a user-defined arc with the Helix 3D toolkit. The user selects 3 points on the arc (start, middle, end) and the program finds the center of the circle and draws the arc from start to end. My problem is I'm not good at math and I am having problems making this work. My main problem is getting the start and end angles and having it draw arcs of all sizes accurately. Any help is appreciated. Here is my code:

    private void Draw_Arc(object sender, MouseButtonEventArgs e)
        {
                linept = new List<Point3D>();
                linept.Add(startPoint);
                linept.Add(endPoint);
                linept.Add((Point3D)GetPoints(e));
                LinesVisual3D line = new LinesVisual3D();
                line.Thickness = 2;
                line.Color = Colors.Blue;
                line.Points = linept;
                port.Children.Add(line);

                double startAngle, sweepAngle;
                Point3D center = GetCenterOfArc(linept.ElementAt(0), linept.ElementAt(1), linept.ElementAt(2));
                GetAngles(linept.ElementAt(0), linept.ElementAt(1), linept.ElementAt(2), out startAngle, out sweepAngle);
                circle = new PieSliceVisual3D();
                double RadiusX = Math.Abs(startPoint.X - center.X);
                double RadiusY = Math.Abs(startPoint.Y - center.Y);
                circle.Center = center;
                if (RadiusX >= RadiusY)
                    circle.OuterRadius = RadiusX;
                else
                    circle.OuterRadius = RadiusY;
                circle.InnerRadius = circle.OuterRadius + 3;
                circle.StartAngle = (180 / Math.PI * Math.Atan2(startPoint.Y - circle.Center.Y, startPoint.X - circle.Center.X));
                circle.EndAngle = (180 / Math.PI * Math.Atan2(linept.ElementAt(2).Y - circle.Center.Y, linept.ElementAt(2).X - circle.Center.X));
                port.Children.Add(circle);
        }