0 Members and 1 Guest are viewing this topic.
Just in case you want the result as a math solution :Code - C#: [Select]using System; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { double radius = 200; double chordLength = 200; double circumference = Math.PI * 2.0 * radius; double enclosedAngleRadians = AngleFromChord(radius, chordLength); double arcLength = ArcLengthFromChord(radius, chordLength); Console.WriteLine("Circumference: " + circumference); Console.WriteLine("Enclosed Angle Radians: " + enclosedAngleRadians); Console.WriteLine("Enclosed Angle Degrees: " + enclosedAngleRadians * (180.0 / Math.PI)); Console.WriteLine("Arc Length: " + arcLength); Console.ReadKey(); } /// <summary> /// Get the arc length from the radius and enclosed angle /// </summary> public static double ArcLengthFromAngle(double radius, double radians) { return radius * radians; } /// <summary> /// Get the angle from the chordLength (only works for angles <= 180) /// </summary> public static double AngleFromChord(double radius, double chordLength) { return radius != 0.0 ? 2.0 * Math.Asin(chordLength / (radius * 2.0)) : 0.0; } /// <summary> ///Get the arc length from the radius and chordLength /// </summary> public static double ArcLengthFromChord(double radius, double chordLength) { if(radius == 0.0) return chordLength; return ArcLengthFromAngle(radius, AngleFromChord(radius, chordLength)); } }}