public void Circle2Points(string p1s, string p2s, string centers, double radius) { var p1 = Point3D.Parse(p1s); var p2 = Point3D.Parse(p2s); var circle3D = new Circle3D(p1, p2, UnitVector3D.ZAxis); AssertGeometry.AreEqual(circle3D.CenterPoint, Point3D.Parse(centers)); Assert.AreEqual(circle3D.Radius, radius, 1e-6); }
public void CircleCenterRadius(string p1s, double radius) { var center = Point3D.Parse(p1s); var cicle3D = new Circle3D(center, UnitVector3D.ZAxis, radius); Assert.AreEqual(2 * radius, cicle3D.Diameter, double.Epsilon); Assert.AreEqual(2 * Math.PI * radius, cicle3D.Circumference, double.Epsilon); Assert.AreEqual( Math.PI * radius * radius, cicle3D.Area, double.Epsilon); }
public void CircleFromThreePoints(string p1s, string p2s, string p3s, string centers, double radius) { var p1 = Point3D.Parse(p1s); var p2 = Point3D.Parse(p2s); var p3 = Point3D.Parse(p3s); var center = Point3D.Parse(centers); var circle = new Circle3D(p1, p2, p3); AssertGeometry.AreEqual(center, circle.CenterPoint); Assert.AreEqual(radius, circle.Radius, 1e-6); }