-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnomeq.m
38 lines (32 loc) · 1.22 KB
/
nomeq.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function NomeQ = nomeq(m,tol)
%NOMEQ gives the value of Nome q = q(m).
%
% NomeQ = nomeq(M,TOL), where 0<=M<=1 is the module and
% TOL is the tolerance (optional). Default value for
% the tolerance is eps = 2.220e-16.
%
% See also
% Standard: ELLIPKE, ELLIPJ,
% Moiseev's package: ELLIPTIC12I, ELLIPTIC3, THETA, AGM.
%
% References:
% [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical
% Functions" Dover Publications", 1965, Ch. 16-17.6.
% GNU GENERAL PUBLIC LICENSE Version 2, June 1991
% http://www.gnu.org/licenses/gpl.html
% Everyone is permitted to copy and distribute verbatim copies of this
% script under terms and conditions of GNU GENERAL PUBLIC LICENSE.
%
% Copyright (C) 2007 by Moiseev Igor. All rights reserved.
% 34106, SISSA, via Beirut n. 2-4, Trieste, Italy
% For support, please reply to
% moiseev[at]sissa.it, moiseev.igor[at]gmail.com
% Moiseev Igor,
% 34106, SISSA, via Beirut n. 2-4, Trieste, Italy
if nargin<2, tol = eps; end
if nargin<1, error('Not enough input arguments.'); end
if ~isreal(m)
error('Input arguments must be real.')
end
NomeQ = exp(-pi*ellipke(1-m,tol)./ellipke(m,tol));
% END FUNCTION nomeq()