Cos: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
JwellsNB (talk | contribs)
JwellsNB (talk | contribs)
Line 22: Line 22:
//Cos calculates the cosine of a number
//Cos calculates the cosine of a number


NSB.Print("The cosine of 0 is " + (Math.cos(0)));
NSB.Print("The cosine of 0 is " + Math.cos(0));
</pre>
</pre>



Revision as of 06:22, 2 May 2013

Cos(number)

Description

Cos calculates the cosine of a number expressing an angle in radians. The required parameter, number, is any numeric expression. The value returned is a double-precision floating-point number that can range from -1 to 1.

To convert degrees to radians, multiply degrees by π/180. To convert radians to degrees, multiply radians by 180/π.

Example (Basic)

Rem Cos Example
'Cos calculates the cosine of a number

Print "The cosine of 0 is " & Cos(0)

Example (JavaScript)

//Cos Example
//Cos calculates the cosine of a number

NSB.Print("The cosine of 0 is " + Math.cos(0));

Output

The cosine of 0 is 1

Related Items

Sin, Tan