Question: Programming Exercise 3.32 shows how to test whether a point is on the left side of a directed line, on the right, or on the
Programming Exercise 3.32 shows how to test whether a point is on the left side of a directed line, on the right, or on the same line. Write the methods with the following headers:
Write a program that prompts the user to enter the three points for p0, p1, and p2 and displays whether p2 is on the left of the line from p0 to p1, right, the same line, or on the line segment. Here are some sample runs:

/** Return true if point (x2, y2) is on the left side of the directed line from (x0, y0) to (x1, y1) */ public static boolean left0fTheLine(double x0, double y0, double x1, double y1, double x2, double y2) /** Return true if point (x2, y2) is on the same line from (x0, y0) to (x1, y1) */ public static boolean onTheSameLine (double x0, double y0, double x1, double y1, double x2, double y2) /** Return true if point (x2, y2) is on the line segment from (x0, y0) to (x1, y1) */ public static boolean onTheLineSegment(double x0, double y0, double x1, double y1, double x2, double y2) Enter three points for p0, p1, and p2: 1 1 2 2 1.5 1.5 (1.5, 1.5) is on the line segment from (1.0, 1.0) to (2.0, 2.0) - Enter Enter three points for p0, p1, and p2: 1 1 2 2 3 3 -Enter (3.0, 3.0) is on the same line from (1.0, 1.0) to (2.0, 2.0) Enter three points for p0, p1, and p2: 1 1 2 2 1 1.5 (1.0, 1.5) is on the left side of the line from (1.0, 1.0) to (2.0, 2.0) Enter Enter three points for p0, p1, and p2: 1 1 2 2 1 -1 (1.0, -1.0) is on the right side of the line from (1.0, 1.0) to (2.0, 2.0) -Enter
Step by Step Solution
3.36 Rating (177 Votes )
There are 3 Steps involved in it
Sample Output 1 Enter three points for p0 p 1 and p2 11221515 15 15 is on the Me segment from 10 10 ... View full answer
Get step-by-step solutions from verified subject matter experts
