File: intc.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 (16 lines) | stat: -rw-r--r-- 588 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function <r>=intc(a,b,f)
//If f is a complex-valued macro,intc(a,b,f) computes
//the integral from a to b of f(z)dz along the straight
//line a-b of the complex plane.
//!
//Author F.D.
//First compile f if necessary:
// Copyright INRIA
if type(f)==11 then comp(f),end;
//Define two functions which define the real part and
//imaginary part of f(g(t))*g'(t) where g(t) is a 
//parametrization of the line a-b.
deff('<r>=real1(t,a,b,f)','r=real(f((1-t)*a+t*b)*(b-a))')
deff('<r>=imag1(t,a,b,f)','r=imag(f((1-t)*a+t*b)*(b-a))')
r=intg(0,1,list(real1,a,b,f))+%i*intg(0,1,list(imag1,a,b,f))