add: func to calculate the coords of any element.