Algorithms Question Three points P, Q, and R are said to be collinear if they are on a single line. To check whether the 3 points lie on the same line, we use the distance formula. If P, Q and R are...


Algorithms Question


Three points P, Q, and R are said to be collinear if they are on a single line. To check whether the 3 points lie on the same line, we use the distance formula. If P, Q and R are three collinear points, then:


Distance from P to Q + Distance from Q to R = Distance from P to R


PQ + QR = PR


The distance between two points (x1, y1) and (x2, y2) is given by


Hence, we can easily find the distance between the points P, Q and R, with the help of this formula.


Design an algorithm (pseudocode) to check whether three points are collinear. In your solution include the input and the output.



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here