%moment about axis example

%All in consistent units of N,m

rA = [ 5 0 0]
rB = [ 0 2 0]
rC = [ 0 0 2]
rD = [ 0 4 0]
F = 10

rAB = rB - rA
rCD = rD - rC
rAC = rC - rA

lambda = rAB/norm(rAB)
u = rCD/norm(rCD)



Fvec = F*u

Mvec = cross(rAC,Fvec)

Maxis = dot(lambda,Mvec)


%%%%%%%%%%%%%

N = cross(rAB,rCD);
n = N/norm(N);

d = dot(rAC,n)