code for calculating pond geometry