Advanced Math Functions

2 min read ·

Trigonometric Functions

Trigonometric functions work with angles in radians, not degrees.

sin(), cos(), tan()


Converting Degrees to Radians


Converting Radians to Degrees


Note

Always convert degrees to radians before using trigonometric functions.


Logarithmic Functions


log()

Returns natural logarithm (base e).

log10()

Returns logarithm base 10.

Pro Tip

Use log10 for base 10 calculations and log for natural logarithm.


Exponential Functions


exp()

Returns e raised to power x.

Combining Concepts


Caution

Passing incorrect values such as negative numbers to log functions can result in errors.


Exercise

  • Convert 60 degrees to radians and find sin value
  • Calculate log10 of 1000
  • Find exponential value of 3
  • Convert pi radians to degrees
Learn Python Advanced Math Functions | Python Course