Definition: Returns the cosine of an angle.


Yes, we know: in a million years you'll never oncehave to calculate the cosine of an angle in one of your scripts. Still, better safe than sorry, right? In Windows PowerShell you can determine the cosine of an angle using the System.Mathclass and the Cos method. This sample command returns the cosine of a 45-degree angle and then stores the value in a variable named $a:


$a = [math]: : cos(45)


When you run this command and then echo back the value of $ a youshould get the following: