Experimentation suggests you may have used something like θ = atan(b/a) for z = a + bi. But that is only valid for a > 0; otherwise, you have to correct the result. Some libraries provide a function called "atan2" that gives a correct angle in all cases. I don't know if FreeBASIC has anything like that, but if you're interested, there's an article on Wikipedia that explains it.
Hmm. Interesting. This is not the same as how it looks in most software; I think it's not correct. For one thing, an image with positive integer exponent x should have (x-1)-fold mirror symmetry centered on the complex plane origin.
Do you happen to know how the exponentiation is being calculated in your program? The standard way, I believe, is using de Moivre's formula et al. to calculate z^x as r^x cis xθ, where z = r cis θ, cis θ := cos θ + i sin θ.
Experimentation suggests you may have used something like θ = atan(b/a) for z = a + bi. But that is only valid for a > 0; otherwise, you have to correct the result. Some libraries provide a function called "atan2" that gives a correct angle in all cases. I don't know if FreeBASIC has anything like that, but if you're interested, there's an article on Wikipedia that explains it.
danielcdawson 11 months ago
Hmm. Interesting. This is not the same as how it looks in most software; I think it's not correct. For one thing, an image with positive integer exponent x should have (x-1)-fold mirror symmetry centered on the complex plane origin.
Do you happen to know how the exponentiation is being calculated in your program? The standard way, I believe, is using de Moivre's formula et al. to calculate z^x as r^x cis xθ, where z = r cis θ, cis θ := cos θ + i sin θ.
danielcdawson 11 months ago