Calculate perimeter

Calculate Bplot perimeter.