Cody

Solution 1805813

Submitted on 4 May 2019 by William
  • Size: 17
  • 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
rpy = (rand(1,3)-0.5)*pi; r = rpy(1); p = rpy(2); y = rpy(3); R = reshape([cos(p).*cos(y),cos(p).*sin(y),-sin(p),-cos(r).*sin(y)+cos(y).*sin(p).*sin(r),cos(r).*cos(y)+sin(p).*sin(r).*sin(y),cos(p).*sin(r),sin(r).*sin(y)+cos(r).*cos(y).*sin(p),-cos(y).*sin(r)+cos(r).*sin(p).*sin(y),cos(p).*cos(r)],[3,3]); z = your_fcn_name(R); assert(all(size(z) == [1 3]), 'shape of z should be 1x3'); err = abs(z*R(:,1)) + abs(z*R(:,2)) assert(sum(abs(err)) < 10*eps)

err = 5.5511e-17