Hello Ve Working C Program Involves Classes Completed Program Need Help One Specs Says Dra Q43884319
Hello, I’ve beenworking on a C++ program that involves classes. I have completedthe program, but I need help in one of the specs that says draw apicture of it. I will post the program specs, but like I said, Ihave it coded, I will supply the output that needs to be drawn byhand. 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 programthat will test the above implementation of ‘points’ class and thatwill convince me your points class is correct. Test all methods inthe Points class and show results.
Also, set up a boxwith 4 points: (2,2) (2,5) (4,5) (4,2)
1. Print out thepoints for the box.
2. Print out thepoints for the box after Translating it x’=2 and y’=1 distance.
3. Continuing withnew set of box points,
print out the box after scaling x by 2 and y by 0.5
4. Original box pts:print out the box after 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 boxpts:
print out the box after shearing in the y direction 1.7
Print out and labeleach of the outputs above.
For each output ofeach box, also draw a picture of the new box (nice accurate boxes)(This is where you take the output of the program and plot thepoints on paper and show everything the output is doing.)
Here is the outputthat needs to be hand drawn: (From the instruction directly abovefrom here)
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 30degree0.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 direction1.5
A: (-0.00505766,7.99905) B: (-1.50506,7.9981) C: (-1.50759,11.9981)D: (-0.00758664,11.999)
Shering y direction1.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