Export (0) Print
Expand All
Expand Minimize

Converting VBScript's Atn Function


Windows PowerShell


Definition: Returns the arctangent of a number.

Abs

Granted, this one doesn't come up too terribly often in system administration scripts. Nevertheless, if you ever do need to calculate the arctangent of an angle you can do so using the System.Math class and the Atan method. This command assigns the arctangent of a 90 degree angle to the variable $a:



$a = [math]::atan(90)

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



1.55968567289729


Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft