random geometry helpers in python