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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:56:17+00:00 2026-05-14T19:56:17+00:00

How can I programmatically detect whether or not two triangles touch each other, given

  • 0

How can I programmatically detect whether or not two triangles touch each other, given their vertices on a 2D coordinate plane? This includes touching points or edges, as well as if one triangle is completely inside the other one.

  • 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-14T19:56:17+00:00Added an answer on May 14, 2026 at 7:56 pm

    Use Line Line intersection

    https://www.topcoder.com/community/data-science/data-science-tutorials/geometry-concepts-line-intersection-and-its-applications/#line_line_intersection

    Also consider the possibility that some vertex might be touching one of the sides of the other triangle.

    http://www.blackpawn.com/texts/pointinpoly/default.html

    function SameSide(p1,p2, a,b)
        cp1 = CrossProduct(b-a, p1-a)
        cp2 = CrossProduct(b-a, p2-a)
        if DotProduct(cp1, cp2) >= 0 then return true
        else return false
    
    function PointInTriangle(p, a,b,c)
        if SameSide(p,a, b,c) and SameSide(p,b, a,c)
            and SameSide(p,c, a,b) then return true
        else return false
    

    Or look at this link and scroll down

    http://compsci.ca/v3/viewtopic.php?t=6034

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

Sidebar

Related Questions

How can I programmatically detect whether the current user has CREATE TABLE permissions in
In my C++ program, how can I detect programmatically at runtime whether symbols have
How can I programmatically detect if a thread has windows handles on it for
how can I detect whether I'm using iphone simulator or ipad simulator. I'm using
How can I detect programmatically if a phone has a camera ?
Possible Duplicate: Best way to programmatically detect iPad/iPhone hardware How can I differentiate the
How I can programmatically detect when text input filled by typing on keyboard and
How can programmatically check which version of the WMI (Windows Management Instrumentation) is installed
I know you can programmatically determine the tranparency color of a .gif Is there
Does anyone know if you can programmatically save a report shown in a reportviewer

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.