Recall that [-y, x] is perpendicular to [x, y]. This is doing such a projection onto the perpendicular of PQ with origin P
briana-jin-zhang
Adding onto RCD's comment, the reason why (−y,x) is perpendicular to (x,y) is because the dot product is 0.
Let n⃗ be the normal vector to PQ⃗ and x⃗ be the vector (x,y) relative to P. Then, the shown equation is essentially the dot product of x and n, x⃗⋅n.
If you were to draw line from P to (x,y), then you end up with a triangle where the bracket is essentially ∣∣x⃗∣∣cosθ where θ is the angle at point P.
So the dot product is proportional to the distance from line PQ since it is ∣∣x⃗∣∣∣∣n⃗∣∣cosθ.
briana-jin-zhang
oof my latex doesn't render as pretty as I would like
yang991178
A quick note for the project implementation: ABC may be either clockwise or counterclockwise. As a result, you need to check for it or the equation here may give the inverse of the correct value.
Recall that [-y, x] is perpendicular to [x, y]. This is doing such a projection onto the perpendicular of PQ with origin P
Adding onto RCD's comment, the reason why (−y,x) is perpendicular to (x,y) is because the dot product is 0.
Let n⃗ be the normal vector to PQ⃗ and x⃗ be the vector (x,y) relative to P. Then, the shown equation is essentially the dot product of x and n, x⃗⋅n.
If you were to draw line from P to (x,y), then you end up with a triangle where the bracket is essentially ∣∣x⃗∣∣cosθ where θ is the angle at point P.
So the dot product is proportional to the distance from line PQ since it is ∣∣x⃗∣∣∣∣n⃗∣∣cosθ.
oof my latex doesn't render as pretty as I would like
A quick note for the project implementation: ABC may be either clockwise or counterclockwise. As a result, you need to check for it or the equation here may give the inverse of the correct value.