term_node_pos function

Determines terminal node position.