annotate scripts/elfun/atan2d.m @ 20830:b65888ec820e draft default tip gccjit

dmalcom gcc jit import
author Stefan Mahr <dac922@gmx.de>
date Fri, 27 Feb 2015 16:59:36 +0100
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19898
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 16938
diff changeset
1 ## Copyright (C) 2013-2015 Rik Wehbring
16938
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
2 ##
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
3 ## This file is part of Octave.
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
4 ##
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
8 ## your option) any later version.
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
9 ##
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
13 ## General Public License for more details.
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
14 ##
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
18
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
19 ## -*- texinfo -*-
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
20 ## @deftypefn {Function File} {} atan2d (@var{y}, @var{x})
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
21 ## Compute atan2 (@var{y} / @var{x}) in degrees for corresponding elements
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
22 ## from @var{y} and @var{x}.
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
23 ## @seealso{tand, atan2}
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
24 ## @end deftypefn
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
25
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
26 function retval = atan2d (y, x)
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
27
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
28 if (nargin != 2)
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
29 print_usage ();
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
30 endif
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
31
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
32 retval = 180 ./ pi .* atan2 (y, x);
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
33
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
34 endfunction
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
35
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
36
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
37 %!assert (atan2d (-1:.1:1, 1:-.1:-1), 180/pi * atan2 (-1:.1:1, 1:-.1:-1), -10*eps)
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
38
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
39 %!error atan2d ()
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
40 %!error atan2d (1)
78c022f1d6f7 Add new function atan2d to Octave.
Rik <rik@octave.org>
parents:
diff changeset
41