Question: Using Java:(Geometry: point position) Given a directed line from point p0(x0, 30) to pl(x1, y1), you can use the following condition to decide whether a
Using Java:(Geometry: point position) Given a directed line from point p0(x0, 30) to pl(x1, y1), you can use the following condition to decide whether a point p2(x2, )2) is on the left of the line, on the right, or on the same line (see Figure 3.11): >0 p2 is on the left side of the line (x1 - x0)"()2 - yo) - (x2 - x0)*(yl - y0) < =0 p2 is on the same line <0 p2 is on the right side of the line p2 p2 PO po PO () (b) (c) FIGURE 3. 1 1 (a) p2 is on the left of the line. (b) p2 is on the right of the line. (c) p2 is on the same line. Write a program that prompts the user to enter the three points for p0, pl, and p2 and displays whether p2 is on the left of the line from p0 to pl, to the right, or on the same line. Here are some sample runs: Enter three points for p0, p1, and p2: 4.4 2 6.5 9.5 -5 4 -Ester p2 is on the left side of the line Enter three points for p0, p1, and p2: 1 1 5 5 2 2 -Later p2 is on the same line Enter three points for p0. p1, and p2: 3.4 2 6.5 9.5 5 2.5 [-Be p2 is on the right side of the line
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
