Open In App

Python | cmath.pi constant

Last Updated : 09 Sep, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

With the help of cmath.pi constant, we can use this constant value in the calculation of area of circle, perimeter of circle and etc.

Syntax : cmath.pi
Return : Return the pi value.

Example #1 :
In this example we can see that by using cmath.pi constant, we are able to drive the mathematical formulas very easily.




# importing cmath library
import cmath
  
r = 5
# using cmath.pi constant
gfg = cmath.pi * r*r
  
print(gfg)


Output :

78.53981633974483

Example #2 :




# importing cmath library
import cmath
  
r = 3
# using cmath.pi constant
gfg = 2 * cmath.pi * r
  
print(gfg)


Output :

18.84955592153876


Similar Reads

Python | cmath.tau constant
With the help of cmath.tau constant, we can use this constant value in the calculation of mathematical formulas. Syntax : cmath.tau Return : Return the tau value. Example #1 : In this example we can see that by using cmath.tau constant, we are able to drive the mathematical formulas very easily. # importing cmath library import cmath # using cmath.
1 min read
Python - cmath.e Constant
cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.e Constant is used to get the eular's number. Syntax: cmath.e Returns: Return the e value. Below examples illustrate the use of above function: Example #1 : C/C++ Code # Python code to implement # the cmath.e constant # importing
1 min read
Python - cmath.inf Constant
cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.inf Constant is used to get the floating-point positive infinity. Syntax: cmath.inf Returns: Return the value of positive infinity Below examples illustrate the use of above function: Example #1 : C/C++ Code # Python code to implemen
1 min read
Python - cmath.infj Constant
cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.infj Constant is used to get the complex positive infinity. Syntax: cmath.infj Returns: Return the complex positive infinity. Below examples illustrate the use of above function: Example : C/C++ Code # Python code to implement # the
1 min read
Python - cmath.nanj Constant
cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.nanj Constant is used to get the complex nan (Not a Number). Syntax: cmath.nanj Returns: Return the complex nan value. Below examples illustrate the use of above function: Example #1 : C/C++ Code # Python code to implement # the cmat
1 min read
Python | cmath.nan Constant
cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.nan Constant is used to get the floating-point nan (Not a Number). Syntax: cmath.nan Returns: Return the floating-point nan value. Below examples illustrate the use of above function: Example #1 : C/C++ Code # Python code to implemen
1 min read
Python | cmath.sqrt() method
With the help of cmath.sqrt() method, we can find the value of square root any number by passing it to cmath.sqrt() method. Syntax : cmath.sqrt(value) Return : Return the square root of any value. Example #1 : In this example we can see that by using cmath.sqrt() method, we are able to get the values of square root by passing value to it. # importi
1 min read
Python | cmath.log10() method
With the help of cmath.log10() method, we can find the value of log of any number having base-10 value by passing it to cmath.log10() method. Syntax : cmath.log10(value) Return : Return the log value of base-10. Example #1 : In this example we can see that by using cmath.log10() method, we are able to get the values of log having base-10 by passing
1 min read
Python | cmath.log() method
With the help of cmath.log() method, we can find the value of log of any number having natural base value by passing it to cmath.log() method. Syntax : cmath.log(value) Return : Return the log value of natural base. Example #1 : In this example we can see that by using cmath.log() method, we are able to get the values of log having natural base by
1 min read
Python | cmath.exp() method
With the help of cmath.exp() method, we can find the exponent of any number by passing it to cmath.exp() method. Syntax : cmath.exp(value) Return : Return the exponential value. Example #1 : In this example we can see that by using cmath.exp() method, we are able to get the values of exponent by passing any value to it. # importing cmath library im
1 min read
Article Tags :
Practice Tags :