Optimization in Differentiable Manifolds in Order to Determine the Method of Construction of Prehistoric Wall-Paintings