Hello Ve Working C Program Involves Classes Completed Program Need Help One Specs Says Dra Q43876722
Hello, I’ve been working on a C++ program that involves classes.I have completed the program, but I need help in one of the specsthat says draw a picture of it. I will post the program specs, butlike I said, I have it coded, I will supply the output that needsto be drawn by hand. Thank you for your time.
Create the “point” class as shown in the text with
- data members are the one listed in the text book plus the new onesbelow
Methods in the text: shift, rotate90, rotations_needed, distance,middle
- Default “constructor” with two arguments for x and ycoordinates
- Add the following methods:
Translation: (x,y) translated to (x’,y’) by adding x’to x and y’ to y value
(x’,y’) = (x+x’, y+y’) where x’ & y’ are int + or – or 0values
Scaling: (x’, y’) = (x’x, y’y) (multiply) where m > 1 makeslarger,
m 0.0 to 1.0 makes smaller
- ( d) = ( x cos d – y sin d, x sin d + y cosd)
where d is the degrees to rotate.
Shearing: (x’, y’) = (x+x’, y) to shear in the x direction
(x, y’+y) to shear inthe y direction
Write a main program that will testthe above implementation of ‘points’ class and that will convinceme your points class is correct. Test all methods in the Pointsclass and show results.
Also, set up a box with 4 points:(2,2) (2,5) (4,5) (4,2)
1. Print out the points for thebox.
2. Print out the points for the boxafter Translating it x’=2 and y’=1 distance.
3. Continuing with new set of boxpoints,
print out the box after scaling x by 2 and y by 0.5
4. Original box pts: print out the boxafter rotating the box by 30 degrees then
print again after rotation another 60 degrees.
(Note: degrees may need to be converted to radians?)
- Original box pts: print out the box after
shearing in the x direction 1.5
6. Original box pts:
print out the box after shearing in the y direction 1.7
Print out and label each of theoutputs above.
For each output of each box, also drawa picture of the new box (nice accurate boxes) (This is where youtake the output of the program and plot the points on paper andshow everything the output is doing.)
Here is the output that needs to behand drawn:
Box is –
A: (2,2) B: (2,5) C: (4,5) D: (4,2)
Translating x=2 , y=1
A: (4,3) B: (4,6) C: (6,6) D: (6,3)
Scaling x=2 , y=.5
A: (8,1.5) B: (8,3) C: (12,3) D: (12,1.5)
Rotate 30 degree0.52381
A: (6.17709,5.30034) B: (5.42681,6.59922) C: (8.89049,8.59995) D:(9.64077,7.30107)
Rotate 60 degree
A: (-1.50506,7.99905) B: (-3.00506,7.9981) C: (-3.00759,11.9981) D:(-1.50759,11.999)
Shering x direction 1.5
A: (-0.00505766,7.99905) B: (-1.50506,7.9981) C: (-1.50759,11.9981)D: (-0.00758664,11.999)
Shering y direction 1.7
A: (-0.00505766,9.69905) B: (-1.50506,9.6981) C: (-1.50759,13.6981)D: (-0.00758664,13.699)
Expert Answer
Answer to Hello, I’ve been working on a C++ program that involves classes. I have completed the program, but I need help in one of…
OR