function [T, B, sigma, Ts_mag, Ts] = resolvestresses(stress_tensor, N)
T=stress_tensor*N; %equation 13.11
sigma = dot(T,N);%equation 13.13
%Now for the shear traction; use the McKenzie construction
B = cross(T,N); %Null vector normal to the plane containing T and N
Ts = cross(N,B); %shear traction direction
Ts_mag = sqrt(Ts(1)^2 + Ts(2)^2 + Ts(3)^2);