complex-numbers Questions
5
I'm trying to build a calculator that does basic operations of complex numbers. I'm using code for a calculator I found online and I want to be able to take user input as a complex number. Right no...
Ostracod asked 9/9, 2016 at 14:7
1
To work with complex numbers, I created a struct Cmplx that stores the real and imaginary parts in two separate variables.
struct Cmplx
{
long double real, imag;
};
I'm having difficulty computin...
Latashialatch asked 4/6, 2024 at 4:15
4
Solved
Let's say I have an array of phases similar to this:
import numpy as np
import matplotlib.pyplot as plt
phase = np.linspace(0., 100., 1000) % np.pi
plt.plot(phase)
plt.show()
(with many disconti...
Isabelisabelita asked 12/9, 2018 at 11:14
3
When I'm passing a complex float(complex.h) from a c++ caller to a c library, the value does not pass correctly when running on a 32 bit power pc. I was using two different open source software lib...
Marlowe asked 24/3, 2016 at 16:3
6
Solved
I'm looking for the most memory-efficient way to compute the absolute squared value of a complex numpy ndarray
arr = np.empty((250000, 150), dtype='complex128') # common size
I haven't found a...
Mouthy asked 25/5, 2015 at 12:3
6
Solved
Is there any good way how to plot 2D array of complex numbers as image in mathplotlib ?
It makes very much sense to map magnitude of complex number as "brightness" or "saturation" and phase as "Hu...
Sorrento asked 11/6, 2013 at 12:25
2
Solved
I cannot work out how to convert an int to a generic type containing complex128. Here is an example which doesn't compile unless the complex128 is commented out:
package main
import "fmt"...
Responser asked 1/6, 2023 at 2:31
1
Solved
I have written a function to compute the Laplace transform of a function using scipy.integrate.quad. It is not a very sophisticated function and currently performs poorly on the probability density...
Distinctive asked 21/10, 2020 at 11:28
6
Solved
This might be a bit foolish but I'm trying to use ctypes to call a function that receives a complex vector as a paramter. But in ctypes there isn't a class c_complex.
Does anybody know how to solv...
Alroy asked 14/11, 2012 at 4:59
3
Solved
I've been finding a strange behaviour of log functions in C++ and numpy about the behaviour of log function handling complex infinite numbers. Specifically, log(inf + inf * 1j) equals (inf + 0.7853...
Residue asked 14/12, 2022 at 12:54
3
Solved
Are complex numbers a supported data-type in Python? If so, how do you use them?
Leadsman asked 3/12, 2011 at 20:12
5
Solved
I'd like to create an Argand Diagram from a set of complex numbers using matplotlib.
Are there any pre-built functions to help me do this?
Can anyone recommend an approach?
Image by LeonardoG...
Magel asked 3/7, 2013 at 10:33
3
Solved
What is the equivalent of Octave's j in NumPy? How can I use j in Python?
In Octave:
octave:1> j
ans = 0 + 1i
octave:1> j*pi/4
ans = 0.00000 + 0.78540i
But in Python:
>>> import...
Arceliaarceneaux asked 5/3, 2015 at 8:8
5
I'm trying to convert an input string to a float but when I do it I keep getting some kind of error, as shown in the sample below.
>>> a = "3 + 3j"
>>> b = complex(a)
Tr...
Shelashelagh asked 8/3, 2017 at 2:11
2
For my research, I need to generate uniform random complex numbers. How to do this in python because there is no such module to generate the complex numbers.
Menadione asked 21/4, 2022 at 14:49
2
Solved
I was kinda surprised when I read the source code of instances of Applicative Complex and Monad Complex from GHC Data.Complex module:
-- | @since 4.9.0.0
instance Applicative Complex where
pure a...
Stclair asked 8/11, 2017 at 13:32
1
Conjugating a complex number appears to be about 30 times faster if the type() of the complex number is complex rather than numpy.complex128, see the minimal example below. However, the absolute va...
Gish asked 20/7, 2022 at 14:38
2
Solved
I've read about and understand floating point round-off issues such as:
>>> sum([0.1] * 10) == 1.0
False
>>> 1.1 + 2.2 == 3.3
False
>>> sin(radians(45)) == sqrt(2) / 2
...
Dawna asked 12/6, 2022 at 22:54
4
Solved
In other words, I want to make a heatmap (or surface plot) where the color varies as a function of 2 variables. (Specifically, luminance = magnitude and hue = phase.) Is there any native way to do ...
Coquito asked 4/3, 2013 at 17:21
2
edit note:
originally question said illegal where now it says unspecified.
Thanks to video comment section of Jason Turner video recently I learned that std::complex<int> is unspecified.
But ...
Uncivil asked 16/12, 2021 at 12:56
6
Solved
For a project in one of my classes we have to output numbers up to five decimal places.It is possible that the output will be a complex number and I am unable to figure out how to output a complex ...
Missy asked 12/10, 2011 at 20:27
3
Solved
Does Apple's Swift language support complex numbers out of the box?
I couldn't find any mention in the docs any equivalent for C++ std::complex nor could I find one when playing with it.
Misguided asked 3/6, 2014 at 0:3
4
Solved
How can I make a Mathematica graphics that copies the behaviour of complex_plot in sage? i.e.
... takes a complex function of one
variable, and plots output of the
function over the specified xran...
Minimize asked 21/3, 2011 at 23:52
2
Solved
While C++11 standard says this about reinterpreting std::complex<double> as doubles:
For any pointer to an element of an array of complex<T> named p and
any valid array index i, reinte...
Lated asked 15/10, 2021 at 22:56
2
Solved
I am converting a matlab code to Python. In matlab there is a line which converting the complex number to the int16:
real = int16(real(-3.406578165491512e+04 + 9.054663292273188e+03i));
imag= int16...
Fonteyn asked 2/9, 2021 at 16:41
1 Next >
© 2022 - 2025 — McMap. All rights reserved.