Microsoft Small Basic

Program Listing: CLN862
' An angle of 1 radian results in an arc whose length is equal to the circle's radius.
' A 180-degree angle results in an arc equal to Pi.
TextWindow.WriteLine("1 radian = " + Math.GetDegrees(1) + " degrees (180/Pi).")
TextWindow.WriteLine("90 degrees = " + Math.GetRadians(90) + " radians (Pi/2).")
TextWindow.WriteLine("180 degrees = " + Math.GetRadians(180) + " radians (Pi).")
TextWindow.WriteLine("Let's check our work...")
TextWindow.WriteLine("180/Pi = " + 180/Math.Pi + " degrees.")
TextWindow.WriteLine("Pi/2 = " + Math.Pi/2 + " radians.")
TextWindow.WriteLine("Pi = " + Math.Pi + " radians.")
TextWindow.WriteLine("-----")

' Given a right (90-degree) triangle with each of the other angles being 45 degrees, and the legs having lengths of 1, 1, and ~1.414:
TextWindow.WriteLine("The sine of a 45-degree angle is: " + Math.Sin(Math.GetRadians(45)) + ", or 1/~1.414.")
TextWindow.WriteLine("The cosine of a 45-degree angle is: " + Math.Cos(Math.GetRadians(45)) + ", or 1/~1.414.")
TextWindow.WriteLine("The tangent of a 45-degree angle is: " + Math.Tan(Math.GetRadians(45)) + ", or 1/1.")
TextWindow.WriteLine("Let's check our work...")
TextWindow.WriteLine("1/" + Math.SquareRoot(2) + " = " + 1/Math.SquareRoot(2))
TextWindow.WriteLine("-----")

' Given a right (90-degree) triangle with the other angles being 63.5 degrees and 26.5 degrees, and the legs having lengths of 1, 2, and ~2.24:
TextWindow.WriteLine("The sine of a 63.5-degree angle is: " + Math.Sin(Math.GetRadians(63.5)) + ", or 2/~2.24.")
TextWindow.WriteLine("The cosine of a 63.5-degree angle is: " + Math.Cos(Math.GetRadians(63.5)) + ", or 1/~2.24.")
TextWindow.WriteLine("The tangent of a 63.5-degree angle is: " + Math.Tan(Math.GetRadians(63.5)) + ", or 2/1.")
TextWindow.WriteLine("Let's check our work...")
TextWindow.WriteLine("2/" + Math.SquareRoot(5) + " = " + 2/Math.SquareRoot(5))
TextWindow.WriteLine("1/" + Math.SquareRoot(5) + " = " + 1/Math.SquareRoot(5))
TextWindow.WriteLine("-----")