Question: Consider three points with coordinates ( x 1 , y 1 ) , ( x 2 , y 2 ) and ( x 3 ,

Consider three points with coordinates (x1,y1),(x2,y2) and (x3,y3). The area of the triangle with the three points as its vertices is then given by:
where 1*||| 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 round-off 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:
p1, a 12 double array storing the x and y coordinates of point 1.
= p2, a 12 double array storing the x and y coordinates of point 2
P3, a 12 double array storing the x and y coordinates of point 3
= 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 =logical1
IN MATLAB please!
Consider three points with coordinates ( x 1 , y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!