~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/elem/sinm.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function x=sinm(a)
 
2
//   sinm - computes the matrix sine 
 
3
//%CALLING SEQUENCE
 
4
//   x=sinm(a)
 
5
//%PARAMETERS
 
6
//   a   : square  matrix
 
7
//   x   : square  matrix
 
8
//!
 
9
// Copyright INRIA
 
10
if type(a)<>1 then error(53),end
 
11
if a==[] then x=[],return,end
 
12
if norm(imag(a),1)==0 then
 
13
  x=imag(expm(%i*a))
 
14
else
 
15
  x=-0.5*%i*(expm(%i*a)-expm(-%i*a));
 
16
end