Skip to content

Instantly share code, notes, and snippets.

@cosinekitty
Created June 10, 2020 00:25
Show Gist options
  • Save cosinekitty/c57282d17dfd5d6c83aff126bcb99496 to your computer and use it in GitHub Desktop.
Save cosinekitty/c57282d17dfd5d6c83aff126bcb99496 to your computer and use it in GitHub Desktop.

Revisions

  1. cosinekitty created this gist Jun 10, 2020.
    6 changes: 6 additions & 0 deletions polar.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    function Polar(x, y) {
    return {
    angle: Math.atan2(y, x),
    radius: Math.sqrt(x*x + y*y)
    };
    }