Trigonometric functions: Difference between revisions
Content added Content deleted
Line 967:
=={{header|Liberty BASIC}}==
<lang lb>' [RC] Trigonometric functions.
' 1. Run as is, for fixed 45 degree 'input'.
' 2. Put other degrees ( 0 to 90) into line 2. ( For '90', the tangent = infinity. )
▲ ' LB works in radians. All six functions are available.
' 3. 'Shorten' decimal places for less accuracy.
' 4. Put radians into line 4. ( 0 to 1.5707963267948966 ). Just delete the 'rem',
' by the Rad example. Now, line 4 data will replace line 2 and 3 data.
3 Rad = Deg / 57.295779513082343
4 rem Rad = 1.27
print "When the angle = "; using("####.###", (Rad) * 57.29577951); " degrees,"
print " (or"; using("###.###############", Rad);" radians), then --"
print
print
print using( "####.###############", cos( Rad)); " = cosine"
print using( "####.##############", tan( Rad)); " = tangent"
print
print "
print "For the 'sine' above, the 'arcsine' is --";
print using("####.####",
print " ( or," ; using("####.###############",asn ( sin ( Rad)));" radians ) "
print "For
print using("
print "
print "For the 'tangent' above, the 'arctangent' is --";
print using("####.####", (atn ( tan ( Rad))) * 57.29577951) ; " degrees"
print " ( or," ; using("####.###############",atn ( tan ( Rad)));" radians ) "
'----------- Output -------------
'When the angle = 45.000 degrees,
' (or 0.785398163397448 radians), then --
'
' 0.707106781186547 = sine
' 0.707106781186548 = cosine
' 1.00000000000000 = tangent
▲ end
'
' Now the inverses --
'For the 'sine' above, the 'arcsine' is -- 45.0000 degrees
' ( or, 0.785398163397448 radians )
'For the 'cosine' above, the 'arccosine' is -- 45.0000 degrees
' ( or, 0.785398163397448 radians )
'For the 'tangent' above, the 'arctangent' is -- 45.0000 degrees
' ( or, 0.785398163397448 radians )
=={{header|Logo}}==
|