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 1093487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:50:02+00:00 2026-05-16T23:50:02+00:00

Greetings, I would like to detect if a segment only ‘touches’ a polygon or

  • 0

Greetings,

I would like to detect if a segment only ‘touches’ a polygon or cross it.

The Figure

alt text

explains my doubt. How to know the difference between cases A and B?
Note that in both situations the red line crosses the polygons in two vertices, one touching by outside and other crossing by inside. I have a segment-segment intersection algorithm, but I don’t know how to use it properly. Any help is appreciated.

  • 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-16T23:50:02+00:00Added an answer on May 16, 2026 at 11:50 pm

    I think there might not be any approach much easier than computing the details at a low level.
    First, you will need robust code to compute the intersection between two segments.
    This is discussed (with code) here. Once you have the intersection points, you need
    to compute how the polygon boundary interacts with your segment in the neighborhoods of those
    intersection points. This is essentially
    repeated LeftOf( ) computations, using the notation in my book.
    In your image, the segment passes through vertex b, while the adjacent vertices a and c
    (in a consecutive sequence (a,b,c)) are both to the same side of b. Therefore, the segment
    does not penetrate to the interior of the polygon in the neighborhood of b. But if a and c
    were on opposite sides of the segment, then it must penetrate.

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

Sidebar

Related Questions

Greetings, Would like to know if we need to explicitly free the string allocated
Greetings, I would like to know what should I do to make appear a
Greetings, I would like to ask if creating Singleton to have only one active
Greetings, I would like to make NUnit execute my unit tests in a random
Greetings, I would like to place an image over a surfaceview. However I would
Greetings, I would like to ask what kind of design pattern will be the
Greetings! :-) I would like to describe a workflow strategy with some gaps in
Greetings, I would like to have child window docked next to my parent window.
Greetings, In my page I would like to display a google map with the
Greetings everyone, i would just like to ask how do i retrieve data rows

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.