File: %25sn.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (31 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (2)
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
function [y]=%sn(x,m)
//Jacobi 's elliptic function with parameter m
//which computes the inverse of the elliptic
//integral for the parameter m.
//x may be a vector.
//The amplitude is computed in fortran and apply
//the addition formulas for elliptic functions
//  x :A point inside the fundamental rectangle
//    :defined by the elliptic integral
//  m :Parameter of the elliptic integral (0<m<1)
//  y :Result
//
//!
//Author F.D.
// Copyright INRIA

[n1,n2]=size(x);
n=n1*n2;
a=amell(real(x),sqrt(m));
s=sin(a);
c=cos(a);
d=sqrt(ones(n1,n2)-m*s.*s);
m1=1-m;
a1=amell(imag(x),sqrt(m1));
s1=sin(a1);
c1=cos(a1);
d1=sqrt(ones(n1,n2)-m1*s1.*s1);
y=(s.*d1+%i*c.*d.*s1.*c1)./(c1.*c1+m*s.*s.*s1.*s1);