An analysis of trajectory formation and handwriting