Math. Radians Inside Math. Sin

Hy,

I write a script for calculating delta e 2000, how to figure this to work on google spreadsheet:

var DH = 2 * (Math.pow((var1 * var2), 0.5)) * (Math.sin((Math.radians(var3))/2));

or this, same error

360 + (Math.degrees(Math.atan2(var1, var2)));

I got this error: TypeError: Cannot find function radians in object [object Math]. (line 232, file "Code")

1

1 Answer

The Math object do not have the method radians().

To convert radians to degrees, divide by (Math.PI / 180), and multiply by this to convert the other way.

6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest