Question: please answer in both python, java Q2: There are lots of problems in engineering where the position of point needs to be evaluated with respect

please answer in both python, java Q2: There are lots of problemsplease answer in both python, java

Q2: There are lots of problems in engineering where the position of point needs to be evaluated with respect to a shape. Evaluation procedures can be phrased in terms of questions. For example, is the point inside (or outside the shape?; Does the point lie on the boundary of the shape?; Does the point lie above/below the shape? Does the point lie to the left or right of the shape?: How far is the point from the perimeter? Len! Right Point is "above and to the "right of therectangle Above 15 Point is to the "right" of the rectangle. Inside Below Figure 2: Classification of an (x,y) cooordinate relative to a rectangle Figure 2 illustrates these ideas for one of the simplest cases possible, one point and a rectangle. Extend the functionality of the Rectangle class so that the possition of a point can be evaluated with respect to a specific rectangle object. The appropriate method declarations are as follows: public boolean isInside (Vertex v) ... public boolean 180utside (Vertex v) (...) public boolean isonPerimeter (Vertex v) ...) public boolean isAbove (Vertex v , ... public boolean is below Vertex v). public boolean isLeft ( Vertex vl ...! public boolean isRight (Vertex v(... If the (x,y) coordinates of a vertex are inside a particular rectangle, then isInside Oshould return true. Otherwise, it should return false. From Figure 2 is should evident that some points will result in multiple methods returning true. For example, points in the top right-hand side of the coordinate system will be outside, to the right, and above the rectangle. Fill in the details of each method, and then develop a test program to exercise the procedures. Perhaps the most straight forward way of doing this is to write an extensive set of tests in the main() method for class Rectangle

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!