You can use the IMARGUMENT function in Google Sheets when you need to know the angle or theta of a given complex number.
The angle of a complex number is also known as the argument or theta and is measured in radians. Knowing the theta of complex numbers is essential when using complex numbers in polar form.
The rules for using the
IMARGUMENT function in Google Sheets are as follows:
- The function requires a complex number as an argument.
- This function then outputs the angle of the complex number.
IMARGUMENToutputs an error if the provided number is not a valid complex number or is equal to 0.
Let’s begin with a quick example of when we can use this function.
In mathematics, complex numbers can be represented as a point in a plane. The form a+bi is called the rectangular coordinate form of a complex number. These points can alternatively be written out in a polar form: r(cosθ+isinθ).
As seen in the image below, the polar form can be derived from the rectangular form by using trigonometric functions. Luckily, Google Sheets already provides us with an easy way to compute these values.
IMARGUMENT function, we can easily get the angle or θ of a certain complex number, and later use it for computations involving polar coordinates.
Let’s learn how to write the
IMARGUMENT function ourselves in Google Sheets and later test out the function with actual date values.
The Anatomy of the IMARGUMENT Function
So the syntax (the way we write) the
IMARGUMENT function is as follows:
Let’s dissect this thing and understand what each of these terms means:
- = the equal sign is how we start any function in Google Sheets.
- IMARGUMENT() is our
IMARGUMENTfunction. It computes the angle of the complex number.
- number refers to the complex number. It can be represented as a real number (e.g., “5”) or as an equation in the form a+bi (e.g., “2+3i”).
- Additionally, we can also use the result of the
COMPLEXfunction which returns a complex number string from its arguments. For example,
IMARGUMENT(=COMPLEX(2,4,"i"))is a valid formula.
A Real Example of Using IMARGUMENT Function
Let’s look into an example of the
IMARGUMENT function being used in a Google Sheet spreadsheet.
As seen in the sample worksheet below, we have a table that converts complex numbers from their rectangular coordinate form to their polar coordinate form.
In Column B, we use
IMARGUMENT to find the theta of the complex numbers found in Column A. Column C uses another function called IMABS to get the absolute value of r of the given complex number. Afterward, we format the results of column B and C with the CONCATENATE function to get the actual polar form.
You can explore the formulas used by making a copy of the spreadsheet above using the link below.
If you’re ready to try out the
IMARGUMENT function in Google Sheets, let’s try writing it on your own.
How to Use IMARGUMENT Function in Google Sheets
- In order to begin using the
IMARGUMENTfunction, select the cell that we will first put our function’s output.
For this particular example, we’ll start with cell B2 and later reuse our formula to fill out the rest of Column B.
- In the Formula Bar, we just simply type the equal sign ‘=‘ to begin the function, followed by ‘IMARGUMENT(‘.
- As seen below, a tooltip box may appear with info on the
IMARGUMENTfunction. We can click on the arrow on the top-right-hand corner of the box to minimize it if necessary.
- Next, we need to select cell A2 as our argument since that is where our first complex number is placed. Afterward, simply hit Enter on your keyboard to let the function evaluate.
Now we know that the angle of 5+2i is 0.38 radians.
- Finally, we can drag down the formula to fill out the rest of the column. Now we have converted all our complex numbers into their polar forms!
This step-by-step guide shows how easy it is to use the
IMARGUMENT function in Google Sheets. Now you know how useful it is when we need to work with complex numbers in the polar form.
You can now use the
IMARGUMENT functions in Google Sheets together with the many other Google Sheets functions available to make great spreadsheets that are easy to use.
Stay notified of new Google Sheets guides like this by subscribing to our newsletter!