Cody

Problem 1206. Angles of the hands of a clock

Solution 594952

Submitted on 11 Mar 2015 by goc3
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
%% t=[7 30 15]; t_correct = [43.625 91.5]; assert(max(abs(clockHandAngDifferences(t)-t_correct))<1e-10);

H = 7 M = 30 S = 15 aH = 225.1250 aM = 181.5000 aS = 90 theta = 43.6250 theta = 43.6250 91.5000

2   Pass
%% t=[11 59 59]; t_correct = [0.0916666666666401 5.89999999999998]; assert(max(abs(clockHandAngDifferences(t)-t_correct))<1e-10);

H = 11 M = 59 S = 59 aH = 359.9917 aM = 359.9000 aS = 354 theta = 0.0917 theta = 0.0917 5.9000

3   Pass
%% t=[3 45 50]; t_correct = [-162.083333333333 -25]; assert(max(abs(clockHandAngDifferences(t)-t_correct))<1e-10);

H = 3 M = 45 S = 50 aH = 112.9167 aM = 275 aS = 300 theta = -162.0833 theta = -162.0833 -25.0000

Suggested Problems

More from this Author2

Community Treasure Hunt

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

Start Hunting!