Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need solution in java Asap 2 . Do They Belong? A triangle formed by the three points a ( x 1 , y 1 )

Need solution in java Asap
2. Do They Belong?
A triangle formed by the three points a(x1,y1),b(x2,y2) and c(x3,y3) is a non-degenerate triangle if the following rules are respected is the length of the line between points a and b):
|ab|+|bc|>|ac|
|bc|+|ac|>|ab|
|ab|+|ac|>|bc|
A point belongs to a triangle if it lies somewhere on or inside the triangle. Given two points ,yp and q=(xq,yq), return the correct scenario number:
0 : If the triangle abc does not form a valid nondegenerate triangle.
1: If point p belongs to the triangle but point q does not.
2: If point q belongs to the triangle but point p does not.
3: If both points p and q belong to the triangle.
4: If neither point p nor point q belong to the triangle.
Example
1=
La
Environment
Autocomplete Ready
I >7mport Java. 10.*; "'
class Result {
ALL
(i)
2
triangle.
yp
)
( ype int x, int yg}
??Write your code here
{
> public class Solution ...
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

Students also viewed these Databases questions