Last active
August 29, 2015 14:00
-
-
Save jadar/f706c3ef42ccb9ce577e to your computer and use it in GitHub Desktop.
Law of Cosines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = 8; | |
var b = 9; | |
var c = 90; | |
c = c * Math.PI/180; | |
var a_square = Math.pow(a, 2); | |
var b_square = Math.pow(b, 2); | |
//console.log(Math.cos(Math.PI)); | |
var answer = Math.sqrt((a_square + b_square) - (2*a*b*Math.cos(c))); | |
console.log(answer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment