function [Ft,Fn]=forces_tan_norJMS(V,F)
% Tangential and normal components of the force F
%     over a particle with velocity V
% Use:  [Ft,Fn]=Fuerzas_tan_nor(V,F)
% V(2,p)  :  Velocities (2 components x p velocities)    [input]
% F(2,p)  :  Forces (2 components x p forces)            [input]
% Ft(2,p) :  Tangential forces (2 components x p forces) [output]
% Fn(2,p) :  Normal forces (2 components x p forces)     [output]

FV = sum(F.*V);                 % scalar product F*V for each particle
V2 = sum(V.^2);                 % scalar product V*V for each particle
Ft = repmat(FV./V2,2,1) .* V;   % tangential force for each particle
Fn = F-Ft;                      % normal force for each particle

end
