Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Angle {
- public:
- Angle(const char* param3) {
- if ((strcmp(param3,"q")!=0) Angle(QuartzClock *c);
- if ((strcmp(param3,"a")!=0) Angle(AnalogClock *c);
- clock = c;
- float angle = clock->GetAngle();
- string angle1;
- }
- char ConvertedAngle(const char* tformat) {
- if (strcmp(tformat,"deg")!=0) {
- angle1=FloatToStr(angle);
- return angle1;
- }
- if ((strcmp(tformat,"rad")!=0) {
- angle=angle*(M_PI)/180;
- angle1=FloatToStr(angle);
- return angle1;
- }
- if ((strcmp(tformat,"dms")!=0) {
- int hrs = int(angle+0.5);
- int minst = (angle-floor(angle))*60;
- int mins = int(minst+0.5);
- int secst = (minst-floor(minst))*60;
- int secs = int(secst+0.5);
- string an;
- sprintf (an, "%s.%s'%s", hrs, mins, secs);
- return an;
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement