JavaScript Vector Function
<p>Does anyone know if there is supposed to be a PI in a simple vector function that takes these values and spits out a new x/y?</p>

<p>Will this work for all vector calculations in a browser situation?</p>

<p>c is a coordinate array [x,y]</p>

<p>a is the angle in degrees</p>

<p>d is the distance</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var vec = function(c,a,d){
nx = c[0] + (Math.cos(a)*d)
ny = c[1] + (Math.sin(a)*d)
return [nx,ny]
}

console.log(vec([10,10],45,50))</code></pre>
</div>
</div>
</p>