using LinearAlgebra # 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) println("tension = ", pn, " Pa") # the angle (in degrees) between the direction of the tension and the normal alpha = acosd(p'*q/pn) println("alpha = ", alpha, " deg.") # tangential component of the tension vector ptang = pn*sind(alpha) println("tangential = ", ptang, " Pa") # tangential component of the tension vector pnorm = pn*cosd(alpha) println("normal = ", pnorm, " Pa")