Stress-based formulation of non-linear planar deformations of elastic straight and curved beams