canvas panel

tricky algebra