title: Vector of double to save distance of every sides in a polygon
body: <p>everyone I want to do a function in a class Polygon who will be save the size of every sides of the polygon in a vector of double. My polygon is build thanks to the class Point. So I success to know how many point I have in my polygon and to print the drawing of the polygon to the screen. But the function to get the sides of every sides of the polygon thanks to the point,  I still have not succeeded</p>
  
  <p>This is my class Point :</p>
  
  <pre><code> Point::Point(double x, double y)
   {
    _x = x;
    _y = y;
   }
   Point::Point(const Point&amp; other) 
   {
    _x = other._x;
    _y = other._y;
   }
   double Point::getX() const
   {
    return _x;
   }
  double Point::getY() const
  {
    return _y;
  }
  double Point::distance(const Point&amp; other)
  {
   return sqrt((getX() - other._x) * (getX() - other._x) + (getY() - other._y) *(getY() - other._y));
  }
  </code></pre>
  
  <p>This is my header of class Polygon :</p>
  
  <pre><code> class Polygon
   {
    public:
     Polygon();
     ~Polygon();
     int numOfPoints() const;
     vector&lt;Point&gt; getPoints() const;
     vector&lt;double&gt; getSides() const;
    protected:
     std::vector&lt;Point&gt; _points;
    };
  </code></pre>
  
  <p>and the cpp of Polygon :</p>
  
  <pre><code> Polygon::Polygon(){}
   Polygon::~Polygon(){}
   int Polygon::numOfPoints() const
   {
    return _points.size();
   }
   vector&lt;Point&gt; Polygon::getPoints() const
   {
    return _points;
   }
   vector&lt;double&gt; Polygon::getSides() const
   {
    vector&lt;double&gt; sides;
   }
  </code></pre>
  
  <p>So I dont know how can I get the size of every sides thanks to class Point. I think it can be do thanks to the function distance of point, but I don't know how. If you can help me.
  Thanks You !</p>