geometry_utils function

Helper functions for making geometric calculations.