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
3 votes
2 answers
84 views

Complex Number class

I wrote a complex number class using JS for practice. ...
user avatar
  • 31
2 votes
2 answers
88 views

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 ...
user avatar
  • 31
4 votes
1 answer
75 views

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 ...
user avatar
  • 1,266
3 votes
1 answer
116 views

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 ...
user avatar
1 vote
1 answer
65 views

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 ...
user avatar
  • 9,587
6 votes
5 answers
3k views

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
9k views

C++ Calculator for complex numbers

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

Implementing Gaussian integers in Haskell

Currently my code (at GitHub) is this: ...
user avatar
15 votes
3 answers
2k views

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 ...
user avatar
4 votes
1 answer
242 views

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 ...
user avatar
  • 713
3 votes
0 answers
841 views

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 ...
user avatar
10 votes
1 answer
456 views

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: ...
user avatar
  • 191
5 votes
1 answer
266 views

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 ...
user avatar
6 votes
3 answers
12k views

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 ...
user avatar
  • 285