Rectangle measurement and calculations