Count For Points Within Coordinates for a circle, rectangle and triangle c++
<p>I am trying to make a program to count the number of points within a circle, triangle and 4 sided polygon. I have about 3500 coordinates, and i want to be able to find out the count for the number of coordinates within these shapes, e.g. for the circle i want to put the centre coordinates and the radius and find the count. Or for the an square like shape, i currently have a formula to take 4 points, and using bubble sort so that way i can order the way that the area is calculated from the points, but i think I'm going around this the wrong way, i have only just started on this code and will put it up but please bare with as I'm just trying to get my head round it before filling it.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;

using namespace std;

void bubblesort(vector&lt;double&gt;&amp; vec) 
{
double s = vec.size();
for (int i=0; i&lt;s; i++) 
    {
    for (int j=i+1; j&lt;s; j++) 
        {
        if (vec[i] &lt; vec[j]) 
            {
            double x = vec[i];
            vec[i] = vec[j];
            vec[j] = x;
            }
        }
    }
}

void squarecount(vector&lt;double&gt;&amp; a, vector&lt;double&gt;&amp; b)
{
    // I am thinking here to put the x,y coordinates, linking each two and getting 4 equations counting the number satisfying all 4 inequalities
}

int main ()
{
    double a;
    cout &lt;&lt; "Please enter the corresponding numberthe shape for which you want to find the count of in your data;" &lt;&lt; endl;
    cout &lt;&lt; "Circle (1)" &lt;&lt; endl;
    cout &lt;&lt; "Triangle (2) " &lt;&lt; endl;
    cout &lt;&lt; "4 Sided Polygon (3)" &lt;&lt; endl;
    cin &gt;&gt; a;

    if ( a == 1)
    {
        return 0;
    }
    else if (a == 2)
    {
        return 0;
    }
    else if (a == 3)
    {
        vector&lt;double&gt; data1;
        vector&lt;double&gt; data2;
        // 4 Sided Polygon
        double x1, x2, x3, x4, y1, y2, y3, y4;
        cout &lt;&lt; "Enter the first x coordinate then press enter, then the corresponding y coordinate" &lt;&lt; endl;
        cin &gt;&gt; data1[0];
        cin &gt;&gt; data2[0];
        cout &lt;&lt; "Enter the second x coordinate then press enter, then the corresponding y coordinate" &lt;&lt; endl;
        cin &gt;&gt; data1[1];
        cin &gt;&gt; data2[1];
        cout &lt;&lt; "Enter the second x coordinate then press enter, then the corresponding y coordinate" &lt;&lt; endl;
        cin &gt;&gt; data1[2];
        cin &gt;&gt; data2[2];
        cout &lt;&lt; "Enter the second x coordinate then press enter, then the corresponding y coordinate" &lt;&lt; endl;
        cin &gt;&gt; data1[3];
        cin &gt;&gt; data2[3];
        bubblesort(data1);
        bubblesort(data2);
    }
    else
    {
        cout &lt;&lt; "Invalid Input!" &lt;&lt; endl;
        cout &lt;&lt; "Please enter either 1 for a circle, 2 for a triangle or 3 for a a 4 sided pollygon" &lt;&lt; endl;

    }


 }
</code></pre>