Best Answer

I assume you refer to programming. Classes of complex numbers already exist for many programming languages (for instance, for Java); if you search for them, you can just use the ready-made classes, or - if you have a classroom task of writing your own class - at least get some useful ideas.The general idea is that you define a class with two fields - in Java that would be fields of type "double" - to store the real and imaginary part. Then you define methods for the desired operation and functions, such as addition, subtraction, multiplication, division, sine, cosine, exp, etc.

As an example, to add two numbers, the method "add" can add the number in the object on which it is invoked, and the other number can be passed as a parameter (argument); the answer can be written back to the object. This would be equivalent to:

a = a + b

As an alternative, you can pass two parameters (other complex numbers - i.e., other objects of the type "complex"), and make your object equal to the sum of the two. This would be equivalent to:

a = b + c

Q: How do you create a class of complex numbers?

Write your answer...

Submit

Still have questions?

Continue Learning about Math & Arithmetic

I found this class that defines complex numbers, and has the capacity of adding them, and much more: http://www.math.ksu.edu/~bennett/jomacg/c.html Basically, you define a class with two fields, one for the real part, and one for the imaginary part.

Complex numbers are a proper superset of real numbers. That is to say, real numbers are a proper subset of complex numbers.

No. Complex numbers is the highest set of numbers you can go, and there are no sets outside of complex numbers.

Real numbers are a proper subset of Complex numbers.

Complex numbers include real numbers, pure imaginary numbers, and the combination of those two.

Related questions

Different languages have different data types. But basically, each class can be considered a different data type. For example, if a language doesn't have a data type for dates, create a class, with fields (or properties) to store day, month, year; if your language doesn't have complex numbers, create a class with two fields of some real type to store the real and the imaginary part; if your language doesn't have a data type to store information about a font (its name, size, and characteristics like being or not being bold), create a class to save information about a font, etc.Different languages have different data types. But basically, each class can be considered a different data type. For example, if a language doesn't have a data type for dates, create a class, with fields (or properties) to store day, month, year; if your language doesn't have complex numbers, create a class with two fields of some real type to store the real and the imaginary part; if your language doesn't have a data type to store information about a font (its name, size, and characteristics like being or not being bold), create a class to save information about a font, etc.Different languages have different data types. But basically, each class can be considered a different data type. For example, if a language doesn't have a data type for dates, create a class, with fields (or properties) to store day, month, year; if your language doesn't have complex numbers, create a class with two fields of some real type to store the real and the imaginary part; if your language doesn't have a data type to store information about a font (its name, size, and characteristics like being or not being bold), create a class to save information about a font, etc.Different languages have different data types. But basically, each class can be considered a different data type. For example, if a language doesn't have a data type for dates, create a class, with fields (or properties) to store day, month, year; if your language doesn't have complex numbers, create a class with two fields of some real type to store the real and the imaginary part; if your language doesn't have a data type to store information about a font (its name, size, and characteristics like being or not being bold), create a class to save information about a font, etc.

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.

It could be an imaginary number or a complex number or on belonging to a higher class of numbers.

I found this class that defines complex numbers, and has the capacity of adding them, and much more: http://www.math.ksu.edu/~bennett/jomacg/c.html Basically, you define a class with two fields, one for the real part, and one for the imaginary part.

Complex math covers how to do operations on complex numbers. Complex numbers include real numbers, imaginary numbers, and the combination of real+imaginary numbers.

Complex numbers are a proper superset of real numbers. That is to say, real numbers are a proper subset of complex numbers.

No. Complex numbers is the highest set of numbers you can go, and there are no sets outside of complex numbers.

Real numbers are a proper subset of Complex numbers.

Complex numbers were not invented by Mr KBH.

A complex village is more advanced than typical villages that are smaller in size. They use more technology, create buildings, and social class divisions.

Complex numbers include real numbers, pure imaginary numbers, and the combination of those two.

Yes, the complex numbers, as well as the real numbers which are a subset of the complex numbers, form groups under addition.