Cody

# Problem 42306. Esoteric Trigonometry

Solution 688437

Submitted on 18 Jun 2015 by LY Cao
• Size: 15
• This is the leading solution.
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)))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

17   Pass
%% theta = pi/3; f_name = 'chord'; 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)))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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