示例#1
0
        public void Initializes_An_Arc_By_Three_Points()
        {
            // Arrange
            Arc arc = _exampleArc3D;

            // Assert
            arc.Length.Should().BeApproximately(71.333203, GSharkMath.MaxTolerance);
            arc.Radius.Should().BeApproximately(16.47719, GSharkMath.MaxTolerance);
            GSharkMath.ToDegrees(arc.Angle).Should().BeApproximately(248.045414, GSharkMath.MaxTolerance);
        }
示例#2
0
        public void It_Returns_A_Rotated_Transformed_Matrix()
        {
            // Arrange
            var    center         = new Point3(5, 5, 0);
            double angleInRadians = GSharkMath.ToRadians(30);

            // Act
            Transform transform = Transform.Rotation(angleInRadians, center);

            // Getting the angles.
            Dictionary <string, double> angles = Transform.GetYawPitchRoll(transform);
            // Getting the direction.
            var axis = Transform.GetRotationAxis(transform);

            // Assert
            GSharkMath.ToDegrees(angles["Yaw"]).Should().BeApproximately(30, GSharkMath.Epsilon);
            axis.Should().BeEquivalentTo(Vector3.ZAxis);
        }
示例#3
0
 /// <summary>
 /// Gets the text representation of an arc.
 /// </summary>
 /// <returns>Text value.</returns>
 public override string ToString()
 {
     return($"Arc(R:{Radius} - A:{GSharkMath.ToDegrees(Angle)})");
 }
示例#4
0
 public void It_Returns_The_Degree_From_Radians(double radians, double degreeExpected)
 {
     System.Math.Round(GSharkMath.ToDegrees(radians), 0).Should().Be(degreeExpected);
 }