Add some computational geometry functions