title: Finding 3D coordinates from point with known XYZ angles, radius and origin?
body: <p>I've read somewhat over 300 pages on the internet, and I didn't get the result I wanted or either it didn't work, so I hope people can help me out over here. You can explain by using pseudo code and maths. :)</p>
  
  <p>So, we have point A (which is the origin). Point A has a radius, an XYZ position and XYZ rotation (I know it can be done with 2 angles, but I really need it to be with 3 angles).
  Point B's position is unknown.</p>
  
  <p>Armed with that information, my question is: how would I find the position of point B? (Alternatively, my question could be rephrased as: "how to find a 3D point on a sphere?") </p>
  
  <p>I've already done it in 2D and there it worked.
  for 2D I used:</p>
  
  <pre><code>x=pointA.x+radius*cos(angle)
  y=pointA.y+radius*sin(angle)
  </code></pre>
  
  <p>I don't use pure matrices but I want to use cosines and such. My attempt (which fails badly, I really have no idea how to combine XYZ rotations with cosines) in pseudo code:</p>
  
  <pre><code>newx=pointA.x+radius*cos(rotationY)*sin(rotationZ+toRadians(90))
  newy=pointA.y+radius*cos(rotationZ-toRadians(90))*math.sin(rotationY)*math.cos(rotationX)
  newz=pointA.z+radius*math.cos(rotationZ+toRadians(90))*sin(rotationX)
  </code></pre>
  
  <p>I would appreciate it so much if someone could help me. :)</p>