answersLogoWhite

0

How do you create a class of complex numbers in c?

Updated: 8/20/2019
User Avatar

Wiki User

9y ago

Best Answer

You must remember that complex numbers need two parts - a real and an imaginar part, so you have to define fields for these parts. You also need to define methods at least for the basic operations, such as addition, subtraction, multiplication and division. You may also want to define methods for more advanced operations, such as trigonometric functions and the exponential function and natural logarithm, all of which have special definitions in the case of complex numbers.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you create a class of complex numbers in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is difference of complex numbers?

If y = a + bi and z = c + di are two complex numbers then z - y = (c - a) + (d - b)i


What denotes a complex number?

Elements of the set C denote complex numbers.


What is the set c?

It is the set of all complex numbers.


The sum of two complex numbers is always a complex number?

A "complex number" is a number of the form a+bi, where a and b are both real numbers and i is the principal square root of -1. Since b can be equal to 0, you see that the real numbers are a subset of the complex numbers. Similarly, since a can be zero, the imaginary numbers are a subset of the complex numbers. So let's take two complex numbers: a+bi and c+di (where a, b, c, and d are real). We add them together and we get: (a+c) + (b+d)i The sum of two real numbers is always real, so a+c is a real number and b+d is a real number, so the sum of two complex numbers is a complex number. What you may really be wondering is whether the sum of two non-real complex numbers can ever be a real number. The answer is yes: (3+2i) + (5-2i) = 8. In fact, the complex numbers form an algebraic field. The sum, difference, product, and quotient of any two complex numbers (except division by 0) is a complex number (keeping in mind the special case that both real and imaginary numbers are a subset of the complex numbers).


Is the product of two imaginary numbers always an imaginary number?

If you are talking about pure imaginary numbers (a complex number with no real part) then no. Example: bi times ci where b and c are real numbers equals b*c*i² = b*c*(-1) = -b*c, which is a real number, because b & c & -1 are all real numbers. If you're talking about multiplying two complex numbers (a + bi)*(c + di), then the product will be complex, but it could be real or imaginary, depending on the values of a, b, c, & d.


What is the difference between real numbers and complex numbers?

Real numbers are a proper subset of complex numbers. In fact each complex number, z, can be represented as z = x +iy where x and y are real numbers and i is the imaginary square root of -1.Thus the set of complex numbers is the Cartesian product of two sets of real numbers. That is, C = R x R where C is the set of complex numbers and R is the set of real numbers. Limitations of this browser prevent me from writing that in a mathematically precise and more helpful fashion.


What class is the IP address 210.23.67.102?

Class B Class A are octets beginning in numbers 1-126 Class B are octets beginning in numbers 128-191 Class C are octets beginning in numbers 192-223


What is the answer for -8i-7i?

Numbers of the form a + ib (where i = -11/2; a and b are real numbers) are called complex numbers.For any two complex numbers (a+ib) and (c+id):Addition:(a+ib) + (c+id) = (a+c) + i(b+d)So, -8i-7i = (-8-7)i = -15i


How do you create a class in C plus plus?

class class_name { private: data_members; public: member_functions; };


What is the sum of complex numbers?

In (a+bi) + (c+di), you add the real parts using the laws for real numbers and do the same for the imanginary parts. (a+c)+(b+d)i


Can you create class in 'c'?

Class acts as an encapsulation of attributes and methods, that is used by an object oriented programming (OOP) language. Since C is not an OOP, its a structural programming language, one can not create classes in C. That is why OOP version of C was developed called C++, where one can work with classes.


How do you create object name for child class in c?

child a=new child();