en:sin [BASIC 256 - Language Documentation]

# BASIC 256 - Language Documentation

en:sin

## Sin (Function)

### Format

sin ( numeric_expr )

returns float_value

### Description

Computes the sine of expression. Expression must be in radians.

### Note

The sin function does not produce an exact result.

### Example

    clg
    color black
    # draw a line across the graphic output
    line 0,150,300,150
    # where do we start
    lastx = 0
    lasty = sin(0) * 50 + 150
    # now step across the line and draw
    for x = 0 to 300 step 5
       angle = x / 300 * 2 * pi
       y = sin(angle) * 50 + 150
       line lastx, lasty, x, y
       lastx = x
       lasty = y
    next x

Draws

### See Also

Abs, Acos, Asin, Atan, Ceil, Cos, Degrees, Exp, Float, Floor, Int, Log, Log10, Radians, Rand, Sin, Sqr, Tan

en/sin.txt · Last modified: 2014/02/08 10:59 by admin