In JavaScript, the function Math.tan(45); returns the value in radians, which is 1.6197751905438615. Basically, how would I get Math.tan(45) to return the answer 1?
In JavaScript, the function Math.tan(45); returns the value in radians, which is 1.6197751905438615. Basically,
Share
Well, the answer is not in radians, as the answer is a fraction of lengths. You should rather use
Math.tan(45 * Math.PI / 180)instead, since the argument has to be in radians.