Diameter calculating function. Handle fps correctly using with statement