vector in space
-
hello i want to define a vector with three or more parameter in space and as i know vector of stl only gets one parameter ,is there any header in stl or other library to solve this? also i have an array of points and i want to sort them on one axis ,how i can sort it with sort() of stl without any change to points? for example i used map for 2 dimension :map but when i set for example 11,12 11,13 it is false. thanks in advance.
-
hello i want to define a vector with three or more parameter in space and as i know vector of stl only gets one parameter ,is there any header in stl or other library to solve this? also i have an array of points and i want to sort them on one axis ,how i can sort it with sort() of stl without any change to points? for example i used map for 2 dimension :map but when i set for example 11,12 11,13 it is false. thanks in advance.
struct point3D
{
double x;
double y;
double z;
};std::vector<point3D> my_vector_of_points;
?
bool sortOnX(const point3D& a, const point3D& b)
{
return a.x < b.x;
}std::sort(my_vector_of_points.begin(), my_vector_of_points.end(), sortOnX)
-
struct point3D
{
double x;
double y;
double z;
};std::vector<point3D> my_vector_of_points;
?
bool sortOnX(const point3D& a, const point3D& b)
{
return a.x < b.x;
}std::sort(my_vector_of_points.begin(), my_vector_of_points.end(), sortOnX)