Given three corner points of a triangle, and one more point P. Write a function to check whether P lies within the triangle or not.
Input:
The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is x1,y1,x2,y2,x3,y3.
The second line of each test case contains x and y.
Output:
Print Yes if point lies inside a triangle else No. Print the output of each test case in a new line.
Constraints:
1 ≤ T ≤ 50
1 ≤ x1,x2,x3,y1,y2,y3 ≤ 100
1 ≤ x,y ≤ 70
Example:
Input
1
0 0 20 0 10 30
10 15
Output
Yes
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.
preparecodinginterview_dot_com | 190 |
__murugan__ | 173 |
manvimahajan20 | 140 |
xiaoyan_yunche | 139 |
ShameekAgarwal | 116 |
preparecodinginterview_dot_com | 190 |
__murugan__ | 173 |
manvimahajan20 | 166 |
SoumyaKaushik | 146 |
arpit_anshuman | 140 |
blackshadows | 5331 |
Ibrahim Nash | 5219 |
akhayrutdinov | 5111 |
mb1973 | 4929 |
Quandray | 4567 |