i'm trying to calculate the X and Z coordinate of a coordinate based on the angle and the distance of the origin (0,0,0). Even though I use a 3-dimensional system I watch from top down which basically means I ignore the Y-axis. See the image reference below so you can see what I mean.
Assuming I have the correct distance in Meters and the angle in Degrees I could calculate the cartesian coordinates relative to the center.
For this I use the following formulas:
X coordinate: d * cos(a * π / 180)
Z coordinate: d * sin(a * π / 180)
The 'd' is the distance, the 'a' is the angle.
The formula's above are the only ones that I found online in terms of calculating cartesian coordinates based on angle and distance, so I figured they are correct. As you can see in the image below the Z-axis (or the Y-Axis) is reversed. But even when I multiply the Z value with -1 I get wrong values.
Example: If I were to have a distance of 5 and a angle of 45 degrees I should basically have the (rounded) coordinate (3,53, 0, -3,53). Again, if you take the referenced image it makes more sense. I just replaced the Y with the Z axis.
Are the formulas wrong or am I doing something wrong? If you need something clearer just ask me and i'll try to explain it :)
Thanks in advance.