Tan


Definition: Returns the tangent of an angle.

  

Good point: Windows PowerShell wouldn’t be much of a scripting language if it allowed you to calculate arctangents but didn'tallow you to calculate tangents. Fortunately, that's not the case: you can determine the tangent of an angle by using the System.Mathclass and calling the Tanmethod. Here’s a command that calculates the tangent of a 45-degree angle and then stores that value in the variable $a:

 

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

 

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

 

1.61977519054386