9 (Geometry: point position) 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...


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


/** 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 side of the line from p0 to p1, right side,


the same line, or on the line segment. Here are some sample runs:

Nov 17, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here