Skip to main content
0 votes
0 answers
69 views

I recently wrote a program which renders the mandelbrot set and encountered some irrelevent issues, which some helpful users solved for me. One user reccommended I change an aspect of my code for ...
Jessica's user avatar
  • 41
0 votes
3 answers
561 views

The expression I am interested in: It mentions I have to use cmath modules for the equation. so far I've tried ans = cmath.sqrt(-1j) + (cmath.e ** (cmath.pi * cmath.sqrt(-1j))) Is putting j after the ...
Z-Ninja's user avatar
1 vote
1 answer
161 views

Is there any difference between the infinities returned by the math module and cmath module? Does the complex infinity have an imaginary component of 0?
Alec's user avatar
  • 9,733
0 votes
1 answer
221 views

Given a Numpy array/matrix, what is pythonic way to count the number of complex, pure real and pure imaginary number: [[ 1. +0.j 1. +0.j 1. +0.j 1. +0.j 1. +0.j ] [ 1. +...
RSW's user avatar
  • 1,546
1 vote
2 answers
862 views

I want to calculate the square root of a numpy array of negative numbers. I tried with np.sqrt() but it gives error beacuse the domain. Then, I found that for complex numbers you can use cmath.sqrt(x) ...
user20186251's user avatar
-1 votes
3 answers
119 views

I have an equation (0.125-(1j*(mu1)*0.125))/(0.125 - cmath.sqrt((0.125**2)-(0.125**2)-((mu1**2)*(0.125**2)))) This is suppose to be 1 for any value of mu1 but it seems I am getting 1 only if mu1 is ...
user3873617's user avatar
0 votes
1 answer
1k views

How can I quickly generate a numpy array of calculated complex numbers? By which I mean, the imaginary component is calculated from an array of values. I have tried using python's literal j without ...
Matt's user avatar
  • 300
1 vote
2 answers
154 views

I have a vector y with size, for example, (1,64). I create a vector in python as follows: vec = np.pi * np.sqrt(-1) * range(len(y)) I get the output values of the vector vec are all nan or the ...
Fatima_Ali's user avatar
-1 votes
1 answer
176 views

I have been trying to insert $e^ix$ as matrix element. The main aim is to find the eigenvalue of a matrix which has many complex functions as elements. Can anyone help me how to insert it? My failed ...
anand_quanta's user avatar
2 votes
2 answers
2k views

I have the following code written in python 2.7. Here I've defined two function, a cosine function and an exponential function and I need to multiply these functions to a float Value, but I am getting ...
Vahid Talebi's user avatar
0 votes
2 answers
578 views

I am making a program that asks the user to input values for a, b and c which are then used to compute the roots using the quadratic formula. The only problem I have is that python treats a and the ...
lain's user avatar
  • 5