Cody

# Problem 42306. Esoteric Trigonometry

Solution 2616859

Submitted on 26 Jun 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
theta = pi/3; f_name = 'sine'; assert(isequal(trig_func_tool(theta,f_name),sin(theta)))

y = 0.8660

2   Pass
theta = pi/3; f_name = 'cosine'; assert(isequal(trig_func_tool(theta,f_name),cos(theta)))

y = 0.5000

3   Pass
theta = pi/3; f_name = 'tangent'; assert(isequal(trig_func_tool(theta,f_name),tan(theta)))

y = 1.7321

4   Pass
theta = pi/3; f_name = 'cosecant'; assert(isequal(trig_func_tool(theta,f_name),csc(theta)))

y = 1.1547

5   Pass
theta = pi/3; f_name = 'secant'; assert(isequal(trig_func_tool(theta,f_name),sec(theta)))

y = 2.0000

6   Pass
theta = pi/3; f_name = 'cotangent'; assert(isequal(trig_func_tool(theta,f_name),cot(theta)))

y = 0.5774

7   Pass
theta = pi/3; f_name = 'versine'; assert(isequal(trig_func_tool(theta,f_name),1-cos(theta)))

y = 0.5000

8   Pass
theta = pi/3; f_name = 'vercosine'; assert(isequal(trig_func_tool(theta,f_name),1+cos(theta)))

y = 1.5000

9   Pass
theta = pi/3; f_name = 'coversine'; assert(isequal(trig_func_tool(theta,f_name),1-sin(theta)))

y = 0.1340

10   Pass
theta = pi/3; f_name = 'covercosine'; assert(isequal(trig_func_tool(theta,f_name),1+sin(theta)))

y = 1.8660

11   Pass
theta = pi/3; f_name = 'haversine'; assert(isequal(trig_func_tool(theta,f_name),(1-cos(theta))/2))

y = 0.2500

12   Fail
theta = pi/3; f_name = 'havercosine'; assert(isequal(trig_func_tool(theta,f_name),(1+cos(theta))/2))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test12 (line 3) assert(isequal(trig_func_tool(theta,f_name),(1+cos(theta))/2))

13   Fail
theta = pi/3; f_name = 'hacoversine'; assert(isequal(trig_func_tool(theta,f_name),(1-sin(theta))/2))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test13 (line 3) assert(isequal(trig_func_tool(theta,f_name),(1-sin(theta))/2))

14   Fail
theta = pi/3; f_name = 'hacovercosine'; assert(isequal(trig_func_tool(theta,f_name),(1+sin(theta))/2))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test14 (line 3) assert(isequal(trig_func_tool(theta,f_name),(1+sin(theta))/2))

15   Fail
theta = pi/3; f_name = 'exsecant'; assert(isequal(trig_func_tool(theta,f_name),sec(theta)-1))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test15 (line 3) assert(isequal(trig_func_tool(theta,f_name),sec(theta)-1))

16   Fail
theta = pi/3; f_name = 'excosecant'; assert(isequal(trig_func_tool(theta,f_name),csc(theta)-1))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test16 (line 3) assert(isequal(trig_func_tool(theta,f_name),csc(theta)-1))

17   Fail
theta = pi/3; f_name = 'chord'; assert(isequal(trig_func_tool(theta,f_name),2*sin(theta/2)))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test17 (line 3) assert(isequal(trig_func_tool(theta,f_name),2*sin(theta/2)))

18   Pass
theta = pi/5; f_name = 'sine'; assert(isequal(trig_func_tool(theta,f_name),sin(theta)))

y = 0.5878

19   Pass
theta = pi/10; f_name = 'cosine'; assert(isequal(trig_func_tool(theta,f_name),cos(theta)))

y = 0.9511

20   Pass
theta = pi/2.5; f_name = 'tangent'; assert(isequal(trig_func_tool(theta,f_name),tan(theta)))

y = 3.0777

21   Pass
theta = 2*pi/3; f_name = 'cosecant'; assert(isequal(trig_func_tool(theta,f_name),csc(theta)))

y = 1.1547

22   Pass
theta = pi/7; f_name = 'secant'; assert(isequal(trig_func_tool(theta,f_name),sec(theta)))

y = 1.1099

23   Pass
theta = pi/13; f_name = 'cotangent'; assert(isequal(trig_func_tool(theta,f_name),cot(theta)))

y = 4.0572

24   Pass
theta = pi/31; f_name = 'versine'; assert(isequal(trig_func_tool(theta,f_name),1-cos(theta)))

y = 0.0051

25   Pass
theta = pi/1.3; f_name = 'vercosine'; assert(isequal(trig_func_tool(theta,f_name),1+cos(theta)))

y = 0.2515

26   Pass
theta = pi/3.3; f_name = 'coversine'; assert(isequal(trig_func_tool(theta,f_name),1-sin(theta)))

y = 0.1854

27   Pass
theta = pi/33; f_name = 'covercosine'; assert(isequal(trig_func_tool(theta,f_name),1+sin(theta)))

y = 1.0951

28   Pass
theta = pi/0.7; f_name = 'haversine'; assert(isequal(trig_func_tool(theta,f_name),(1-cos(theta))/2))

y = 0.6113

29   Fail
theta = pi/0.3; f_name = 'havercosine'; assert(isequal(trig_func_tool(theta,f_name),(1+cos(theta))/2))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test29 (line 3) assert(isequal(trig_func_tool(theta,f_name),(1+cos(theta))/2))

30   Fail
theta = pi/13; f_name = 'hacoversine'; assert(isequal(trig_func_tool(theta,f_name),(1-sin(theta))/2))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test30 (line 3) assert(isequal(trig_func_tool(theta,f_name),(1-sin(theta))/2))

31   Fail
theta = pi/31; f_name = 'hacovercosine'; assert(isequal(trig_func_tool(theta,f_name),(1+sin(theta))/2))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test31 (line 3) assert(isequal(trig_func_tool(theta,f_name),(1+sin(theta))/2))

32   Fail
theta = pi/30; f_name = 'exsecant'; assert(isequal(trig_func_tool(theta,f_name),sec(theta)-1))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test32 (line 3) assert(isequal(trig_func_tool(theta,f_name),sec(theta)-1))

33   Fail
theta = pi/1.3; f_name = 'excosecant'; assert(isequal(trig_func_tool(theta,f_name),csc(theta)-1))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test33 (line 3) assert(isequal(trig_func_tool(theta,f_name),csc(theta)-1))

34   Fail
theta = pi/13; f_name = 'chord'; assert(isequal(trig_func_tool(theta,f_name),2*sin(theta/2)))

Output argument "y" (and maybe others) not assigned during call to "trig_func_tool". Error in Test34 (line 3) assert(isequal(trig_func_tool(theta,f_name),2*sin(theta/2)))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!