%This function is for internal use only. It may be removed in the future.

%rotParentToChild Compute matrix defining rotation from parent's coordinate
%frame into child's coordinate frame.
%   R = driving.internal.rotParentToChild(ROLL,PITCH,YAW) returns the
%   matrix defining the rotation required to transform a set of points from
%   the parent's coordinate frame into the child's coordinate frame, where
%   the child's coordinate frame is offset from the parent's frame by the 3
%   Euler angles: ROLL, PITCH, and YAW. All angles are defined as scalars
%   in degrees.
%
%   Notes
%   -----
%   - Roll, pitch and yaw use an ISO convention, with clockwise positive
%     angle directions when looking in the positive direction of Z, Y and
%     X-axis of the parent's coordinate frame respectively.
%
%   % Example:
%   %   Rotate the point (0,1,0) into the child's coordinate frame.
%   %   The child's frame is defined relative to the parent with an offset
%   %   of (5,0,10) from the parent's origin and rotations of:
%   %
%   %       Roll:    5 degrees
%   %       Pitch:  15 degrees
%   %       Yaw:   -20 degrees
%
%   xParent = [0 1 0]';
%   T = [5,0,10]'; Offset of child's origin from parent's origin
%   roll = 5;
%   pitch = 15;
%   yaw = -20;
%   R = driving.internal.rotParentToChild(roll,pitch,yaw);
%   xChild = R*(xParent-T);

%   Copyright 2016 The MathWorks, Inc.

% internal function, no error checking is performed

%#codegen

function R = rotParentToChild(roll,pitch,yaw)
R = driving.internal.rotChildToParent(roll,pitch,yaw)';
end

