This could probably wind up in app/views/topology/utils.js ?  I don't know that it will be used anywhere outside the topology, since it deals specifically with positions related to the canvas.