Problem

(Geometry: point position) Programming Exercise shows how to test whether a point is on th...

(Geometry: point position) Programming Exercise 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:

/** Return true if point (x2, y2) is on the left side of the

* directed line from (x0, y0) to (x1, y1) */

public static boolean leftOfTheLine(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)

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:

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT