Intermediate Dynamics for Engineers: A Unified Treatment of Newton-Euler and Lagrangian Mechanics