Moved geometry calculator to lib