def get_diamond_c_from_original_coords(x,y, a,b, width, height,padding =22, radius=22):
    """
    formula is 
    ax + by + c = 0
    x = (xorig + padding - wc) / norm
    y = (yorig + padding - hc) / norm
    where x, y is in diamond space
    """
    wc = (width + padding * 2 - 1) / 2
    hc = (height + padding * 2 - 1) / 2
    norm = max(wc, hc) - padding
    
    c = -(a * (x+padding -wc)) / norm - (b * (y +padding - hc)) / norm
    return c