Find the direction of the trajectory (2 points) crossing the body (in 2D)

I am looking for math that gives me the direction in which I cross the body. I have no ideas, I know that this should be a very simplified application of trigonometry, but I tried different things without success. Not sure if this is the best approach.

Here are the details:

enter image description here

So, I have a body that rotates at a given angle, and I need to find out if I enter the body from it or from it in front. The trajectory in this use case is determined by the position of the mouse (when moving), so I can draw a line from the previous Point and the current point.

Hope someone can help me with this :) and thanks very much in advance.

+3
source share
2 answers

, . , , .

movement = currentPoint - previousPoint

, , ( "", ), : movement dot normal > 0, , . .

, - , , , . , movement, ( , normal ), movement normal : angle = arccos(movement dot normal)

, , , . , . ( , .)

+2

, , , . , 2 , , , .

, , , , "" , , .

0

All Articles