I mostly just wrote mine by hand unless I needed something complex. E.g. just halving the y delta until 1, then doubling the x delta for however long, then the reverse.