ReadyBASIC
BASIC Language Reference Manual > Command and Function Reference >

SIN Function

Summary

Calculates the sine of a given angle (in radians).

Syntax

SIN(angle in radians)

Remarks and Examples

The SIN function calculates the sine of an angle, returning the result as a floating-point value.

The angle is assumed to be a value in radians.

To convert degrees to radians, use the formula x * pi / 180, where pi = 3.1415926.

Sample program:

10 FOR X = 0 TO 100 STEP 0.1
20 A = 40 + (SIN(X) * 25)
30 FOR Y = 1 TO A : PRINT " "; : NEXT Y
40 PRINT "*"
50 NEXT X



Copyright 2006-2008, Kevin Matz, All Rights Reserved.