Problem 558. Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners
Points = [x, y]; Triangle = [x1, y1; x2, y2; x3, y3]
Return true or false for each point tested.
For example, input: Points = [0, 0.5]; Triangle = [0, 0; 1, 0; 1, 1] output: y = 0;
Solution Stats
Problem Comments
-
11 Comments
it was hard..nic problem
The test has rounding problems.
That was hard to me but not impossible. Great!
nice one
but it took so much of time
Good problem!
it's soooooo hard
tip 组成内部角 和为 360 度
Interesting problem! Especially hard when everything has to be in one function
Still can't imagine how to solve this one
This was an interesting one
This was honestly pretty fun!
Solution Comments
Show commentsProblem Recent Solvers1390
Suggested Problems
-
Return the largest number that is adjacent to a zero
5202 Solvers
-
1822 Solvers
-
1172 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
10262 Solvers
-
特定の値がベクトル内に含まれているかを確認するコードを書こう
293 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!