Curve and Surface Fitting via Optimisation Technique