Applying Trigonometric Functions

Math.log(2); //returns 0.693 Math.sin(0); //returns 0 Math.cos(0); //returns 1 Math.tan(1); //returns 1.5574

The Math object provides several trigonometric methods that apply trig functions to numbers. Table 2.3 lists the trig methods to apply things such as natural logs, sine, cosine, and tangent operations.

Image

Table 2.3 Match Object Trigonometric Methods

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.