Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7613907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:16:03+00:00 2026-05-31T02:16:03+00:00

Im trying to define if a point is inside a polygon. Only the coordinates

  • 0

Im trying to define if a point is inside a polygon. Only the coordinates of the corners are given. After some research I found the Ray casting algorithm but it looks like i need a vector filled with the coordinates of the polygons side. I tried to calculate these coordinates as well, but it doesn’t look like this is the solution.

Maybe I’m interpreting the algorithm wrong so it would be nice if someone could push me into the right direction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:16:05+00:00Added an answer on May 31, 2026 at 2:16 am

    I am assuming you are trying to do this for any kind of polygon.

    Check this out to get a handle on the techniques for solving complicated polygons. This is actually what you probably want and it is the ray casting algorithm you mentioned before.
    http://alienryderflex.com/polygon/

    A short explanation of that is you have a polygon, you know its points. Construct connections between the points (vectors). Cast a ray across the entire polygon through the point you are trying to test.

    At each intersection of the ray with one of the polygon vectors increment a counter by 1 starting from 0. If you intersect the point and that counter is even it is not in the polygon. If the counter is odd then that point is inside the polygon.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to determine if a point is inside a polygon. the Polygon is
I'm trying to define a new URL handler under OSX that will point at
I'm trying to define variable inside function. vars() shows variable is created, but gives
I am trying to define a dynamic array containing char pointers that point to
As part of a larger problem, I am trying to define an array inside
I am trying to define my minor mode, mimicking it after isearch-mode (since it
I'm trying to create a point class which defines a property called coordinate. However,
Im trying to define a dataTemplate for a business object in my wpf application
Im trying to define a select tag in my view. My view looks like
I'm trying to define a task that emits (using echo) a message when a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.