Skip to content

Instantly share code, notes, and snippets.

@cosinekitty
Created June 10, 2020 00:19
Show Gist options
  • Select an option

  • Save cosinekitty/fbbd02e4cd8337a3de0253932aafd3d1 to your computer and use it in GitHub Desktop.

Select an option

Save cosinekitty/fbbd02e4cd8337a3de0253932aafd3d1 to your computer and use it in GitHub Desktop.

Revisions

  1. cosinekitty created this gist Jun 10, 2020.
    11 changes: 11 additions & 0 deletions oops1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    function UnitTest() {
    const polar = Polar(3.0, 4.0);
    const expected_distance = 5.0;
    const diff = polar.distance - expected_distance;
    if (Math.abs(diff) > 1.0e-12) {
    console.error('ERROR: Excessive distance error: ', diff);
    return 1;
    }
    console.log('PASS');
    return 0;
    }