I am trying to fill a vector with a specific distribution of nonuniform screen points. These points represent some x and y position on the screen. At some point I am going to draw all of these points on the screen, which should be unevenly distributed at the center. Basically, the frequency of points should increase as you get closer to the center, where one side of the screen is a reflection of the other (can "Mirror over the center of the screen")
I was thinking about using some sort of formula (like y=cos(x) between -pi/2 and pi/2) where the resulting y would equal the frequency of the points in that area of the screen (where -pi/2 would be the leftmost side of the screen, vice versa), but I got stuck on how I would even be able to apply something like this when creating points to put onto the vector. Note: There is a specific number of points that must be generated
If the above hypothesis is not able to work, maybe a cheaty way of achieving this would be to constantly reduce some step size between each point, but I don't know how I would be able to ensure that the specific number of points reach the center.
Ex.
// this is a member function inside a class PointList
// where we fill a member variable list(vector) with nonuniform data
void PointList::FillListNonUniform(const int numPoints, const int numPerPoint)
{
double step = 2;
double decelerator = 0.01;
// Do half the screen then duplicate and reverse the sign
// so both sides of the screen mirror eachother
for (int i = 0; i < numPoints / 2; i++)
{
Eigen::Vector2d newData(step, 0);
for (int j = 0; j < numPerPoint; j++)
{
list.push_back(newData);
}
decelerator += 0.01f;
step -= 0.05f + decelerator;
}
// Do whatever I need to, to mirror the points ...
}
Literally any help would be a appreciated. I have briefly looked into std::normal_distribution, but it appears to me that it relies on randomness, so I am unsure if this would be a good option for what I am trying to do.