Problem 45271. Calculate triangle area
Imagine that you want to calculate the areas of some triangles given in matrix form. First the coordinates of the vertices of the triangles are in a matrix called coords where the line number represents the vertex number and the column number is the dimension, in this case it is equal to 2 (x, y). The way the nodes connect are found in the lnods matrix where the line number is the triangle number and the column number is the vertex number that makes up each triangle (v_i, v_j, v_k).
Solution Stats
Problem Comments
-
1 Comment
Could you please not use isequal() to compare floating-point numbers?
Solution Comments
Show commentsProblem Recent Solvers14
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
2873 Solvers
-
20486 Solvers
-
Operate on matrices of unequal, yet similar, size
184 Solvers
-
Circular Primes (based on Project Euler, problem 35)
467 Solvers
-
8597 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!