Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ programming 1.2) Class PointXY The class PointXY will be used below in questions in this exam. class PointXY { public: PointXY() { x =

c++ programming 1.2) Class PointXY The class PointXY will be used below in questions in this exam. class PointXY { public: PointXY() { x = 0; y = 0; } void set(double a, double b) { x = a; y = b; } double getx() const { return x; } double gety() const { return y; } private: double x, y; } This question uses the class PointXY defined in Sec. 1.2 and the class Polygon defined in Question 2. Write a function rotate90 with the following signature. PointXY rotate90(const PointXY &u); Math formula: 1. If the coordinates in u are (x, y), the coordinates in the output object are (?y, x). 2. This is the mathematical operation of rotating a point counterclockwise through 90? . Write a function rotate90 with the following signature. Polygon rotate90(const Polygon &p); 1. If the points in the polygon p are vi , the points in the output object are rotate90(v[i]). 2. This is the mathematical operation of rotating a polygon counterclockwise through 90? . Hence if q = rotate90(p), then the polygon q is the polygon p rotated counterclockwise through 90? . Note: 1. You may assume the polygon p is not empty. 2. Do not waste time on validation checks to test if num <= 0 in p.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions

Question

Discuss how innovation drives change in an organisation.

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago