Javascript math not returning expected value
I'm trying to calculate the slant height of a conical frustrum (right circular cone) for a given
r1,
r2, and
h. I'm using this
calculator to check my math but I can't get it to match up!
var r1 = 3.0;
var r2 = 4.0;
var h = 5.0;
var s = Math.sqrt(Math.pow(r1 - r2, 2)) + Math.pow(h , 2);
console.log(s);
// > Returns: 26
// > Expected: 5.099