I have kind of a meta question about trigonometry!
Am I right in assuming that the following calculation/formula gives me the angle alpha between a two-dimensional vector and the x-axis of a plane (i.e. xy-plane)?
For the y-coordinate of the vector being bigger than 0:
alpha = acos(vector x / vector length)
For the y-coordinate being smaller or equal to 0:
alpha = 2 x Pi - acos(vector x / vector length)
Furthermore, how would I go about introducing 3D space into this? I mean calculating the angle for three-dimensional vectors? This would only be possible in the local plane of the vector and the x-axis, wouldn’t it?
as for the 3D space, it depends what you want to calculate and to what ends.
You can get the 3 components of your 3d vector or consider a plane it resides in as your axes and treat it as a 2d vector.
If you want to have some freedom in 3d space though, as @fertig said, you should be able to use dot product and cross product with ease.
the first equation is right because vector x/ vector length = cos(α)
the second equation is also right but just coincidentally: explementary angles have same x values
(if you were to analyze the sine it would be:
α = 2*π - asin(-vector y/ vector length)