Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class QuartzClock {
- public:
- QuartzClock(Time* t);
- float GetAngle() {
- angle = 0;
- int hours = this->t = t.GetHours();
- if (hours>12) hours = hours - 12;
- int minutes = this->t.GetMinutes();
- angle = abs(hours*30-minutes*6); if (angle>180) angle=abs(180-angle);
- return angle;
- }
- private:
- float angle;
- Time t;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement