TI99 Environment

SINRAD and COSRAD


Syntax

float-variable = SINRAD(angle)

float-variable = COSRAD(angle)

Description

The SINRAD sine function gives the trigonometric sine of angle, expressed in radians. If the angle is in degrees, multiply the number of degrees by PI/180 to get the equivalent angle in radians.

The COSRAD cosine function gives the trigonometric cosine of angle, expressed in radians. If the angle is in degrees, multiply the number of degrees by PI/180 to get the equivalent angle in radians.

Use float variables for additional precision.

  Example Code
Example 1: SINRAD and COSRAD
` Clock - From Book - "Texas Instruments Home Computer Graphics Programs"
` Page 50
 FOR N# = 1.0 TO 12.0
    IF N# > 3.0 THEN CX = 32 ELSE CX = 49    
    CN = N# + 45.0
    IF CN < 49 THEN CN = CN + 2        
    R = 12.0 - (10.0 * SinRad(N# / 6.0 * PI()))
    C = 16.0 - (10.0 * CosRad(N# / 6.0 * PI()))
    CALL_HCHAR(R,C - 1,CX,1)
    CALL_HCHAR(R,C,CN,1) : tiwait(50)
 NEXT N 
DO : LOOP

Example 2: SINRAD and COSRAD
` Aztec Art 
 randomize timer()
 CALL_CLEAR() 
 call_char(128,rpt$("f",16))
 call_color(setnumber(128),10,11)
 CALL_SCREEN(11)
 FOR X#=10.0 TO 1.0 STEP -1.0
 FOR N#=1.0 TO 12.0
 R#=12.0-(X#*SINRAD(N#/6.0*PI()))
 C#=16.0-(X#*CoSRAD(N#/6.0*PI()))
 CALL_HCHAR(R#,C#,128,1): tiwait(50)
 NEXT N#
 NEXT X#
 do : call_screen(rnd(16)) : tiwait(rnd(100)) : loop
 end


Go back to ...

TI99E Commands Menu
Main Menu

Copyright © Carlos Santiago Lebron - TI99 Environment 2020