Q: Is there predefined 2D point in C/C++ with predefined arithmetic operations? I am currently writing a simulation, which works a lot with 2D points/vectors. Thus I find my self writing code, which looks like this:
double force_1[2] = {0.0, 0.0};
double force_2[2] = result_of_calculation();
force_1[0] = force_1[0] + force_2[0];
force_1[1] = force_1[1] + force_2[1];

Is there a class in C/C++, which can represent a 2D vector and (most important) has all basic arithmetic operations predefined ? I would like to do:
double force_1[2] = {0.0, 0.0};
double force_2[2] = result_of_calculation();
force_1 += force_2;
force_1 *= force_2;

More:
The simulation is not written in C but in Python.
I am working with Cython and I would like to drop my Numpy dependency.
force_1 = np.array((0.0, 0.0))
# type force_2 is np.ndarray
force_2 = result_of_calculation()
force_1 += force_2
force_1[1] = force_1[1] + force_2[1]


A: As already mentioned, C++ only, GLM would be the best choice.
Alternatively, if possible, AVX - Advanced Vector Extensions
For GCC have a look at this Using Vector Instructions through Built-in Functions
