Mercurial > hg > octave-nkf
comparison scripts/elfun/cscd.m @ 14220:5a13a75c2457
Use Octave spacing conventions for scripts in elfun/ directory.
* acosd.m, acot.m, acotd.m, acoth.m, acsc.m, acscd.m, acsch.m, asec.m, asecd.m,
asech.m, asind.m, atand.m, cosd.m, cot.m, cotd.m, coth.m, csc.m, cscd.m,
csch.m, sec.m, secd.m, sech.m, sind.m, tand.m: Use Octave spacing conventions.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 18 Jan 2012 21:17:14 -0800 |
parents | 72c96de7a403 |
children | f3d52523cde1 |
comparison
equal
deleted
inserted
replaced
14219:addec4a8a787 | 14220:5a13a75c2457 |
---|---|
23 ## @end deftypefn | 23 ## @end deftypefn |
24 | 24 |
25 ## Author: David Bateman <dbateman@free.fr> | 25 ## Author: David Bateman <dbateman@free.fr> |
26 | 26 |
27 function y = cscd (x) | 27 function y = cscd (x) |
28 | |
28 if (nargin != 1) | 29 if (nargin != 1) |
29 print_usage (); | 30 print_usage (); |
30 endif | 31 endif |
32 | |
31 y = 1 ./ sind (x); | 33 y = 1 ./ sind (x); |
34 | |
32 endfunction | 35 endfunction |
33 | 36 |
34 %!error(cscd()) | |
35 %!error(cscd(1,2)) | |
36 %!assert(cscd(10:10:90),csc(pi*[10:10:90]/180),-10*eps) | |
37 %!assert(cscd([0,180,360]) == Inf) | |
38 %!assert(cscd([90,270]) != Inf) | |
39 | 37 |
38 %!assert (cscd (10:10:90), csc (pi*[10:10:90]/180), -10*eps) | |
39 %!assert (cscd ([0, 180, 360]) == Inf) | |
40 %!assert (cscd ([90, 270]) != Inf) | |
41 | |
42 %!error cscd () | |
43 %!error cscd (1, 2) |