
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
arg() function for Complex Number in C++
A complex number is a number that is expressed in the form of a + bi, where a and b are real numbers. i is the imaginary part of number.
The argument is the angle between the positive axis and the vector of the complex number. For a complex number
z = x + iy denoted by arg(z),
For finding the argument of a complex number there is a function named arg() of a complex number in the complex header file.
Syntax
arg(complex_number);
Parameter
The function accepts a complex number as input to calculate the value of the argument for that complex number.
Returned value
The function returns the argument of the complex number.
Example
#include<iostream> #include<complex.h> using namespace std; int main (){ double a = 12.0, b = 56.0; complex<double> complexnumber (a, b); cout<<"The argument of complex number "<<a<<" + i"<<b<< " is: "; cout<<arg(complexnumber)<<endl; return 0; }
Output
The argument of complex number 12 + i56 is: 1.3597
- Related Articles
- abs() function for complex number in c++ ?
- acosh() function for complex number in C++
- acos() function for complex number in C++?
- asin() function for complex number in C++?
- atan() function for complex number in C++?
- tanh( ) function for complex Number in C++
- log() function for complex number in C++
- log10() function for complex number in C++
- tan() function for complex number in C++
- Cos() function for complex number in C++
- pow() function for complex number in C++
- polar() function for complex number in C++
- exp() function for complex number in C++
- sqrt ( ) function for complex number in C++
- Sinh( ) function for complex number in C++

Advertisements