I’m working on some JavaScript and I’ve run across a problem with the math:
var p1 = {x:0,y:0}, p2 = {x:1,y:1};
return Math.sin(45) * Math.sqrt((Math.pow(p2.x-p1.x,2) + Math.pow(p2.y-p1.y,2)));
Returns 1.203359304667218
But when I do the same calculation on my calculator, it returns 1 which is what I expect this calculation to return. Can anyone explain this?
What mode did you work on with calculator?
Radians or Degrees?
Guess that could be your “problem” which may be solved easily 🙂