function [Ix_angle,Iy_angle,Ixy_angle]= ...
inertang(Angle,Ix,Iy,Ixy)
%
% [Ix_angle,Iy_angle,Ixy_angle]= ...
% inertang(Angle,Ix,Iy,Ixy)
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% This function calculates the inertia
% values for a geometry rotated by
% angle Angle.
%
% Angle - angle to determine the inertia
% values for in degrees.
% (positive measured CCW from
% positive x-axis)
% Ix - inertia about y-axis
% Iy - inertia about x-axis
% Ixy - product of inertia about x-y
%
% Ix_angle - Ix at Angle
% Iy_angle - Iy at Angle
% Ixy_angle - Ixy at Angle
%
% User m functions called: none
%----------------------------------------------
degrad=pi/180;
angle_rad=degrad*Angle; t2=2*angle_rad;
Iavg=0.5*(Ix+Iy); Idiff=0.5*(Ix-Iy);
cost2=cos(t2); sint2=sin(t2);
Ix_angle=Iavg+Idiff*cost2-Ixy*sint2;
Iy_angle=Iavg-Idiff*cost2+Ixy*sint2;
Ixy_angle=Idiff*sint2+Ixy*cost2;