As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [complex-numbers]

Questions about complex numbers (numbers in the form of x + y∙i where i² = -1), types to represent them in programming languages, and libraries to manipulate them

Filter by
Sorted by
Tagged with
2 votes
2 answers

Template Complex class

I have created a class Complex which represents a complex number of any arbitrary arithmetic type. Overloads are given for the 4 common functions, addition, ...
finlay morrison's user avatar
3 votes
2 answers

Complex Number class

I wrote a complex number class using JS for practice. ...
laki's user avatar
  • 31
2 votes
2 answers

Shunting Yard Calculator - Extended to negative, complex, etc

This project is based off the shunting yard algorithm and has additional features such as negative value parsing. It's like a scientific calculator. I am looking to improve this project by getting rid ...
Paradox's user avatar
  • 31
5 votes
1 answer

Complex number class in Lua

This is my first attemp with Lua. I decided to create this class, because it have lots of "tweaks" and "tricks". I want to know if I did it as best practices Lua ways. My Lua ...
Nick's user avatar
  • 1,356
3 votes
1 answer

Python Simple Range and Bearing Calculator using Complex Numbers

I have just written this code that takes an initial coordinate and returns a new vector depending on a user-supplied range and bearing. The calculation of the new position is done using Complex ...
GalacticPonderer's user avatar
1 vote
1 answer

Solving roots of negative numbers

As part of an assignment for college summer classes, I was tasked with writing a program that solves roots of negative numbers. I've ran it through the test cases I was provided and it computes ...
Linny's user avatar
  • 9,832
6 votes
5 answers

C++ Calculator for complex numbers - follow-up

After following the suggestions from the first question on that topic (link), I'd like to show you the result now: ...
user avatar
11 votes
3 answers

C++ Calculator for complex numbers

I've written a little calculator in C++ for complex numbers: ...
user avatar
5 votes
1 answer

Implementing Gaussian integers in Haskell

Currently my code (at GitHub) is this: ...
schuelermine's user avatar
16 votes
3 answers

Radix2 Fast Fourier Transform implemented in C++

Note: If you don't know much about Fourier transform algorithms, a simple review of whether I am doing anything inefficient with C++ in general would be appreciated. I've been working on implementing ...
tjwrona1992's user avatar
4 votes
1 answer

Complex Newton's Method

I'm trying to build a complex Newton's method. I've submitted a PR here, where you can see the documentation and tests, as well as get a compiling example. I'd appreciate y'alls help reducing the ...
user14717's user avatar
  • 713
3 votes
0 answers

Complex multiplication and integration with CUDA

I want to perform multiplication on two vectors and integrate it in a vector called acc_y. The acc_y variable will update over ...
sbhatporia's user avatar
10 votes
1 answer

Vectorizing the product of an array of complex numbers

I am trying to write fast/optimal code to vectorize the product of an array of complex numbers. In simple C this would be: ...
Simd's user avatar
  • 191
5 votes
1 answer

Parsing and plotting complex numbers

I am trying to write a Haskell application that parses a bunch of complex numbers from a Mathematica output and then produces a PPM image. The end product looks like this: The code to create this is ...
Frank Wang's user avatar
7 votes
3 answers

Basic complex number class

As part of my C++ training, I wanted to create a basic complex number class for basic complex number calculations. The class should have the following: constructor (non explicit, for implicit ...
yaloner's user avatar
  • 295