How to convert from Trigonometric coordinate to Cartesian coordinate

Apologise if the question is too trivial onthis forum, but I’m completely noob on this library. I’m about to upgrade a system that had to previously convert <x,y,z> vectors into <angular> vectors by pure math, dot by dot. The system consists of a mechanical arm, and the board computes the coordinate transformation by trigonometric calculations. However, the new board has a GPU inside, which has the OpenGL featured, so I wish know what is the function of the library that I should use to do that.

Thanks in advance.

I didn’t even realize there was a different way to write vectors like this. lol But I’m pretty good at digging for answers.

I assume you mean that you want to change the vectors into “spherical vectors” as described here. I found the math to do it. It looks pretty straight forward and you could write your own function to do it. But GLM is the math library for OpenGL and I think it may have some functions for this. The conversion of “euclidean” coordinates to “polar” coordinates might be what’s needed in 3D space.

You may also want to google “compute shader polar coordinates” to look into doing this on the GPU in GLSL. Compute shaders are a thing now, where you use the GPU to do math instead of graphics. If that’s what you want, you should probably be looking at writing a compute “shader” in GLSL. You could try googling something like “glsl compute shader example”.

Many thanks !
The function tvec3 does exactly what I need.