I was not very clear about this in class because I confused the meaning of dX_i and dY_i. The slide is actually correct. What makes it work out:
-> Notice that dX_i is the difference between the X coordinate of P_{i+1} and P_{i}
-> Similarly, dY_i is the difference between the Y coordinate of P_{i+1} and P_{i}
-> Notice that the outward pointing normal n of this line is [ dY_i, -dX_i ]^T
Now the math works out to what I derived on the board: E_i(x, y) = E_i(q) = (q-P_0) . n
I was not very clear about this in class because I confused the meaning of dX_i and dY_i. The slide is actually correct. What makes it work out:
-> Notice that dX_i is the difference between the X coordinate of P_{i+1} and P_{i} -> Similarly, dY_i is the difference between the Y coordinate of P_{i+1} and P_{i} -> Notice that the outward pointing normal n of this line is [ dY_i, -dX_i ]^T
Now the math works out to what I derived on the board: E_i(x, y) = E_i(q) = (q-P_0) . n
(sorry about the LaTex notation)