Matlab point in polygon help needed

Code with C | Programming: Projects & Source Codes Forums MATLAB Matlab point in polygon help needed

This topic contains 3 replies, has 1 voice, and was last updated by  Adan 3 years, 3 months ago.

  • Author
  • #9280


    Basically when a user clicks any of the polygon I want a function that returns the polygon clicked as well as the area of the polygon.

    Here is what I have so far, looking for suggestions to compute point in polygon and area. Thanks.

  • #9281


    Those came to my mind, I suggest you to stick with ginput.

  • #9282


    The quick and dirt solution I think is through calculating the area and using a function that draw a polygon shaped button. It doesn’t seem too optimized. I’m looking through the documentation searching something clean. In the meantime you can “square” your polygon to obtain an approximate polygon and you can add a specific event when you click it. A sort of an invisible square that acts like a button.

  • #9283


    I was thinking of writing a function that finds a point in polygon. The main challenge now is how this function will determine which polygon was clicked.

    Because if I have:
    Area = polyarea(polygon)
    The polygon parameter has to be retrieved first from the click event before parsing into the area function.

You must be logged in to reply to this topic.