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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:51:10+00:00 2026-05-16T11:51:10+00:00

How can I test whether a line has a point that lies within (not

  • 0

How can I test whether a line has a point that lies within (not on the edge of) a triangle. (All in 2D).

Currently I’m thinking I’ll do this:

  • Define the line, and each side of the triangle as Ax+By+C=0, and have an xrange.
  • Check if the line intersects any of the lines of the triangle.
  • If it does, check that this is NOT at the end of the line.

Is there a better way to do this?

  • 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-16T11:51:10+00:00Added an answer on May 16, 2026 at 11:51 am
    1. substitute the 3 points into the line’s equation. e.g. if the line is 4x − 3y + 2 = 0, and the triangle’s vertices are (2, 1), (4, 3), (0, 5), we get the values 7, 9 and -13 respectively.

    2. check if all values are of the same sign. If yes, the line does not intersect the triangle. In the above example, the line intersects the triangle.

      http://www.imgftw.net/img/743059947.png

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

Sidebar

Related Questions

I'm currently using checkboxes to set permissions within my PHP application. On the user
Since upgrading from 4.7 to ECC6 the ABAP compiler has become a lot stricter
I have a PHP script that creates other PHP files based on user input.
The question is not how to tell in a oneliner. If you're writing the
I have an old system that uses XML for it's data storage. I'm going
A class went to a school trip. And, as usually, all N kids have
I am developing a mac program in an intel mac, under OS X. It
I have a Gtk::TreeView with a Gtk::TreeModel and a Gtk::TreeModelFilter. The Tree Model is
I am running Ubuntu and am ultimately trying to connect Tomcat to my MySQL
I am struggling with a method of walking a directory tree to check existence

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.