Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 RectangleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started