Trajectory formation and handwriting: a computational model