Example #1
0
 /// <summary>
 /// Create a circle from the midpoint between two points, in a direction along a specified axis
 /// </summary>
 /// <param name="p1">First point on the circumference of the circle</param>
 /// <param name="p2">Second point on the circumference of the circle</param>
 /// <param name="axis">Direction of the plane in which the circle lies</param>
 public Circle3D(Point3D p1, Point3D p2, UnitVector3D axis)
 {
     this.CenterPoint = Point3D.MidPoint(p1, p2);
     this.Axis        = axis;
     this.Radius      = p1.DistanceTo(CenterPoint);
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Circle3D"/> struct.
        /// Create a circle from the midpoint between two points, in a direction along a specified axis
        /// </summary>
        /// <param name="p1">First point on the circumference of the circle</param>
        /// <param name="p2">Second point on the circumference of the circle</param>
        /// <param name="axis">Direction of the plane in which the circle lies</param>
        /// <returns>A <see cref="Circle3D"/></returns>
        public static Circle3D FromPointsAndAxis(Point3D p1, Point3D p2, UnitVector3D axis)
        {
            var cp = Point3D.MidPoint(p1, p2);

            return(new Circle3D(cp, axis, cp.DistanceTo(p1)));
        }