some geometry helper funcs