An introduction to mechanics