Question: Play with Geometric Shapes in 2 D Coordinate System Given two sets of closed geometrical shapes each having a point, a circle, a triangle and
Play with Geometric Shapes in D Coordinate
System
Given two sets of closed geometrical shapes each having a point, a circle, a triangle
and a rectangle, find the following:
Question: Is the point lie on all closed geometric shapes in set
Question: Is the point lie on all closed geometric shapes in set
Question: Are alike shapes in set and set intersect?
Question: Are shapes in set bigger than set
Note that, all the geometric shapes are filled. This means, if a point is inside a circle
or any other shape, then they are in contact. Similarly, two different radius
concentric circles are also in contact. Just think of filled circle as disk.
Individual display of set and set geometrical objects in D coordinate
system:
Set:
Set:
Display of both sets in one D coordinate plane:
Combined:
Programming hints:
The following classes may required:
point
circle
triangle
rectangle
geometry
Input is two copies a point, circle, triangle, rectangle for set and set
A point is defined as
A circle is defined as radius and center point
A triangle is defined as three non collinear points and
A rectangle is defined as two points top left and bottom right
Note: Assume that rectangle sides are parallel to coordinate axes.
listing them gives:
Input Format:
The first line of input will contain a single integer denoting the number of test
cases.
Each test case consists of two lines of input, each line contains values separate
by a space and these two input lines represent the set and set objects.
Output Format:
For each test case, there are six lines of output which described as
In line print true or false.
In line print true or false.
In line print a boolean array of size separated by space.
In line to print a table of size by adjacent elements are separated by space.
Constraints:
coordinates points
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
