# Opengl in 500 lines point in triangle question

https://github.com/ssloy/tinyrenderer/wiki/Lesson-2-Triangle-rasterization-and-back-face-culling

I am on lesson 2 of the "Opengl in 500 lines" tutorial. I follow the part of the lesson in "The method I adopt for my code", but I don't understand this leap from

P = A + uAB-vector + vAC-vector


to

0-vector = uAB-vector + vAC-vector + PA-vector.


• math.stackexchange.com/questions/4322/…
– user144188
Commented Jan 1, 2021 at 10:22
• if I understand if you have P = A + uAB + vAC and you substract P on both sides then you get 0 = A + uAB + vAC - P but A - P can mean vector PA Commented Jan 2, 2021 at 11:10
• this is it, make it the answer and I'll check it Commented Jan 2, 2021 at 17:33
• I'll break out the second part of my question into a new one, I should have just started with the question that was just answered Commented Jan 2, 2021 at 17:36

If I understand if you have

 P = A + uAB + vAC


and you substract P on both sides then you get

 0 = A + uAB + vAC - P


and you change order

 0 = A - P + uAB + vAC


but A - P can mean vector PA

 0 = PA + uAB + vAC