all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
deg = 35 ; arbitrary number of degrees
|
||||
rad = !dtor*deg ; system variables !dtor and !radeg convert between rad and deg
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
; the trig functions receive and emit radians:
|
||||
print, rad, sin(rad), asin(sin(rad))
|
||||
print, cos(rad), acos(cos(rad))
|
||||
print, tan(rad), atan(tan(rad)) ; etc
|
||||
|
||||
; prints the following:
|
||||
; 0.610865 0.573576 0.610865
|
||||
; 0.819152 0.610865
|
||||
; 0.700208 0.610865
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
; the hyperbolic versions exist and behave as expected:
|
||||
print, sinh(rad) ; etc
|
||||
|
||||
; outputs
|
||||
; 0.649572
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
;If the input is an array, the output has the same dimensions etc as the input:
|
||||
x = !dpi/[[2,3],[4,5],[6,7]] ; !dpi is a read-only sysvar = 3.1415...
|
||||
print,sin(x)
|
||||
|
||||
;outputs:
|
||||
; 1.0000000 0.86602540
|
||||
; 0.70710678 0.58778525
|
||||
; 0.50000000 0.43388374
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
; the trig functions behave as expected for complex arguments:
|
||||
x = complex(1,2)
|
||||
print,sin(x)
|
||||
|
||||
; outputs
|
||||
; ( 3.16578, 1.95960)
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
invocable all
|
||||
procedure main()
|
||||
|
||||
d := 30 # degrees
|
||||
r := dtor(d) # convert to radians
|
||||
|
||||
every write(f := !["sin","cos","tan"],"(",r,")=",y := f(r)," ",fi := "a" || f,"(",y,")=",x := fi(y)," rad = ",rtod(x)," deg")
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue