Question: Consider three points with coordinates ( x 1 , y 1 ) , ( x 2 , y 2 ) and ( x 3 ,
Consider three points with coordinates and The area of the triangle with the three points as its vertices is then given by:
where represents the absolute value of the determinant of the matrix inside. Note that the determinant can be negative, so its absolute value should be taken to obtain the area.
In addition, we must account for floating point roundoff errors and the limits of machine precision. To this end, the points are considered collinear if Area tol, where tol is a small tolerance value specified by the user.
Define a function named iscollinear which takes as input:
p a double array storing the x and y coordinates of point
p a double array storing the and coordinates of point
P a double array storing the and coordinates of point
tol, a double indicating the value of the tolerance
and returns as output:
collinear, a logical variable indicating whether the points are collinear or not
Example:Output:collinear logical
IN MATLAB please!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
