Questions tagged [complex-numbers]

This challenge involves the manipulation of complex numbers, including parsing and printing them as well as performing complex arithmetic. This tag also encompasses generalised complex numbers like quaternions.

Filter by
Sorted by
Tagged with
49
votes
14answers
4k views

Too Fast, Too Fourier: FFT Code Golf

Implement the Fast Fourier Transform in the fewest possible characters. Rules: Shortest solution wins It can be assumed that the input is a 1D array whose length is a power of two. You may use the ...
12
votes
3answers
1k views

Solve a 2x2 Eigensystem

For those with a little linear algebra background, the challenge is as simple as this: determine the eigenvalues and eigenvectors of a given complex 2x2 matrix. You may skip ahead to The Challenge for ...
3
votes
7answers
738 views

Resolve quadratic equation

Challenge: Write the smallest program (in characters) that resolves quadratic equations i.e. ax² + bx + c = 0 Rules: Given 3 numbers in R comma-delimited on ...
64
votes
9answers
4k views

Addition in base -1+i

Gaussian integers are complex numbers of the form a+bi where a and b are both integers. In ...
32
votes
19answers
5k views

Draw a graph of \$y=(-n)^x\$

Challenge Given an input of an integer, \$n\$ (where \$0<n<50\$), output the graph of \$y=\mathrm{Re}((-n)^x)\$ from \$x = -3\$ to \$x = 3\$ inclusive. Where \$\mathrm{Re}(p)\$ is the real ...
28
votes
51answers
5k views

Find i^n, given n

The Challenge In as few characters as possible, find the value of \$i^n\$, given \$n\$, a positive integer greater than 0. This should be outputted as a String. For those that don't know, \$i\$ is ...
17
votes
5answers
946 views

What's the voltage over each component?

The picture below shows a RLC circuit. A RLC circuit is an electrical circuit consisting of a resistor (R), an inductor (L), and a capacitor (C), connected in series or in parallel. (1) In order to ...
8
votes
3answers
482 views

Counting Eisenstein primes

Introduction Eisenstein integers are complex numbers of the form a+bω Where a,b are integers, and ...