Mercurial > hg > ishara
annotate general/numerical/scalar/zeta.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | db7f4afd27c5 |
children |
rev | line source |
---|---|
samer@4 | 1 function [f] = zeta(z) |
samer@4 | 2 % zeta - Riemann Zeta function |
samer@4 | 3 % |
samer@4 | 4 % zeta :: complex -> complex. |
samer@4 | 5 % |
samer@4 | 6 %tested on version 5.3.1 |
samer@4 | 7 % |
samer@4 | 8 % This program calculates the Riemann Zeta function |
samer@4 | 9 % for the elements of Z using the Dirichlet deta function. |
samer@4 | 10 % Z may be complex and any size. Best accuracy for abs(z)<80. |
samer@4 | 11 % |
samer@4 | 12 % Has a pole at z=1, zeros for z=(-even integers), |
samer@4 | 13 % infinite number of zeros for z=1/2+i*y |
samer@4 | 14 % |
samer@4 | 15 % |
samer@4 | 16 %see also: Eta, Deta, Lambda, Betad, Bern, Euler |
samer@4 | 17 %see also: mhelp zeta |
samer@4 | 18 |
samer@4 | 19 %Paul Godfrey |
samer@4 | 20 %pgodfrey@conexant.com |
samer@4 | 21 %3-24-01 |
samer@4 | 22 |
samer@4 | 23 zz=2.^z; |
samer@4 | 24 k = zz./(zz-2); |
samer@4 | 25 |
samer@4 | 26 f=k.*deta(z,1); |
samer@4 | 27 |
samer@4 | 28 p=find(z==1); |
samer@4 | 29 if ~isempty(p) |
samer@4 | 30 f(p)=Inf; |
samer@4 | 31 end |
samer@4 | 32 |
samer@4 | 33 return |
samer@4 | 34 |