Difference between revisions of "COS"

From QB64 Wiki
Jump to navigation Jump to search
(Created page with 'Purpose: To return the cosine of the range of x. '''Syntax:''' COS(x) '''Comments:''' x must be the radians. COS is the trigonometric cosine function. To convert from degrees t…')
 
imported>Clippy
Line 1: Line 1:
Purpose:
Purpose:
To return the cosine of the range of x.
To return the cosine of the of a radian angle.


'''Syntax:'''
'''Syntax:'''
Line 34: Line 34:
  -1
  -1
  -1
  -1
''See also:'' [[SIN]], [[ATN]], [[TAN]]
==Navigation:==
[[Keyword_Reference_-_Alphabetical|Go to Keyword Reference - Alphabetical]]
[[Keyword Reference - By usage|Go to Keyword Reference - By usage]]

Revision as of 19:08, 7 September 2009

Purpose: To return the cosine of the of a radian angle.

Syntax: COS(x)

Comments: x must be the radians. COS is the trigonometric cosine function. To convert from degrees to radians, multiply by π/180.

COS(x) is calculated in either single or double precision depending on its argument.

COS(4) 
-.6536436
COS(4#)
-.6536436208636119

Example 1:

X=2*COS(.4)
PRINT X

RUN

1.842122

Example 2:

PI=3.141593
PRINT COS(PI)
DEGREES=180
RADIANS=DEGREES*PI/180
PRINT COS(RADIANS)

RUN

-1
-1


See also: SIN, ATN, TAN


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage