Question: Write a subroutine in Fortran to ascertain whether three points are collinear. Collinearity of three points (x1, y1), (x2, y2), and (x3, y3) can
Write a subroutine in Fortran to ascertain whether three points are collinear. Collinearity of three points (x1, y1), (x2, y2), and (x3, y3) can be determined using the following formula: Collinearity formula: (x2-x1) * (y3-yl) - (x3 - x1) * (y2-yl)=0 The subroutine will take the coordinates of the three points (x1, y1), (x2, y2), and (x3, y3) as inputs and will return a logical value. If the points are collinear, the subroutine should return true; otherwise, it should return false. Additionally, develop a main program that prompts the user to input the coordinates of the three points. After calling the subroutine to check collinearity, the main program should print an appropriate message indicating whether the points are collinear or not.
Step by Step Solution
There are 3 Steps involved in it
fortran subroutine checkcollinearityx1 y1 x2 y2 x3 y3 collinea... View full answer
Get step-by-step solutions from verified subject matter experts
