title: 3D Vector defined by 2 angles
body: <p>So basically I'm looking for a way to calculate the x, y and z component of a vector using 2 angles as shown:
  <img src="https://i.stack.imgur.com/PfZUs.png" alt="enter image description here" />
  Where alpha is the 2D angle and beta is the y angle.
  What I've been using uptill now for 2D vectors was:</p>
  <pre><code>x = Math.sin(alpha);
  z = Math.cos(alpha);
  </code></pre>
  <p>After searching on stackexchange math I've found this forumula doesn't really work correctly:</p>
  <pre><code> x = Math.sin(alpha)*Math.cos(beta);
   z = Math.sin(alpha)*Math.sin(beta);
   y = Math.cos(beta);
  </code></pre>
  <p>Note: when approaching 90 degrees with the beta angle the x and z components should approach zero.
  All help would be appreciated.</p>