C-ified distance function appears to be working, callable using ctypes