clear format compact % stress tensor S = [100 100 160; 100 0 -150; 160 -150 -60]; % unit normal vector q = [1/2.0; 1/2.0; 1/sqrt(2.0)]; % tension vector and its norm p = S*q; pn = norm(p) % the angle (in degrees) between the direction of the tension and the normal alpha = acosd(p'*q/pn) % tangential component of the tension vector ptang = pn*sind(alpha) % tangential component of the tension vector pnorm = pn*cosd(alpha)