Jump to content
  • Advertisement
Sign in to follow this  
bfogerty

How to verify if a point lies between 2 vectors?

This topic is 3778 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you verify if a point lies between 2 vectors? If I have 2 2d vectors and a 2d point, how can I know that the point lies between the 2 vectors like in a radar view system? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Could you just get the angles for the three vectors (treating point as a vector), and see that the one lies between the other two. Also making sure the distance from the origin is less than the length of the other vectors if need be.

Share this post


Link to post
Share on other sites
2 dot products. For the left vector use the right hand normal and for the right vector use the left hand normal. Take the vector of 2D point - center of the radar. Perform the dot product (v1.x*v2.x+v1.y*v2.y) and if it's > 0 for both then it's between the vectors. Research it and test it out on paper.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!