Home

Download

Features

Screenshots

Handbook

Browse Source

Authors

SourceForge.net Logo
Hosted by SourceForge.net

OSI Certified


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Search  

polarcoord.h

00001 /***************************************************************************
00002                           polarcoord.h  -  description
00003                              -------------------
00004     begin                : Sun May 26 2002
00005     copyright            : (C) 2002 by Fungmeista
00006     email                : mizunoami44@sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef POLARCOORD_H
00019 #define POLARCOORD_H
00020 
00021 #define PI 3.141592653589
00022 
00023 class RectCoord;
00024 
00029 class PolarCoord
00030 {
00031     public:
00032         static const unsigned int RADIANS = 0;
00033         static const unsigned int DEGREES = 1;
00034 
00035         PolarCoord(double radius=0,double angle=0,int angleMode=RADIANS, bool bearing=false);
00036         RectCoord toRectangular();
00037         double x() const;
00038         double y() const;
00039         inline void setAngleMode(const unsigned int m){angleMode = m;}
00040         inline double getAngle(){return angle;}
00041         inline double getRadius(){return radius;}
00042         inline void setBearingMode(bool m){bearingMode = m;}
00043 
00044     private:
00045         double radius;
00046         double angle;
00047         unsigned int angleMode;
00048         bool bearingMode;
00049 };
00050 
00051 #endif //PolarCoord
00052