How to resolve the algorithm Trigonometric functions step by step in the Icon and Unicon programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Trigonometric functions step by step in the Icon and Unicon programming language

Table of Contents

Problem Statement

If your language has a library or built-in functions for trigonometry, show examples of: using the same angle in radians and degrees. For the non-inverse functions,   each radian/degree pair should use arguments that evaluate to the same angle   (that is, it's not necessary to use the same angle for all three regular functions as long as the two sine calls use the same angle). For the inverse functions,   use the same number and convert its answer to radians and degrees. If your language does not have trigonometric functions available or only has some available,   write functions to calculate the functions based on any   known approximation or identity.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Trigonometric functions step by step in the Icon and Unicon programming language

Source code in the icon programming language

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


  

You may also check:How to resolve the algorithm Validate International Securities Identification Number step by step in the 360 Assembly programming language
You may also check:How to resolve the algorithm System time step by step in the SETL programming language
You may also check:How to resolve the algorithm Solve a Hidato puzzle step by step in the Racket programming language
You may also check:How to resolve the algorithm Set step by step in the RPL programming language
You may also check:How to resolve the algorithm Evolutionary algorithm step by step in the Aime programming language