An Algorithm for the Workspace of a General n-R Robot