Determining the Endpoint of a Segment