changeset 28920:601b6c7728ed

maint: match names in documentation to input parameters in function. * rotx.m, roty.m, rotz.m: Reformat documentation to 80 columns. Rename output to "T". Rename input to "angle". Re-use angle variable and delete "angle_in_rad" variable. * computer.m: Rename input "a" to "arch". * default_prefix.m: Add second input "desc" to Texinfo documentation. Add FIXME as second input appears unused. * camlookat.m: Remove extra blank line in documentation. * __line__.m: Rename input "parent" to "hp" in documentation. * __plt__.m: Rename input "hparent" to "hp" in documentation. * __add_default_menu__.m: Add input "htb" to documentation. Rename input "hfig" to "hf" in documentation. Briefly document all three inputs. * __parse_movargs__.m: Add input "caller" to documentation. Document caller input.
author Rik <rik@octave.org>
date Tue, 13 Oct 2020 23:19:09 -0700
parents 7bc983bc2cbd
children 967cfcde2e35
files scripts/geometry/rotx.m scripts/geometry/roty.m scripts/geometry/rotz.m scripts/miscellaneous/computer.m scripts/pkg/private/default_prefix.m scripts/plot/appearance/camlookat.m scripts/plot/draw/private/__line__.m scripts/plot/draw/private/__plt__.m scripts/plot/util/private/__add_default_menu__.m scripts/signal/__parse_movargs__.m
diffstat 10 files changed, 43 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/geometry/rotx.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/geometry/rotx.m	Tue Oct 13 23:19:09 2020 -0700
@@ -27,8 +27,8 @@
 ## @deftypefn {} {@var{T} =} rotx (@var{angle})
 ##
 ## @code{rotx} returns the 3x3 transformation matrix corresponding to an active
-## rotation of the vector about the x-axis by the specified @var{angle}, given
-## in degrees, where a positive angle corresponds to a counterclockwise
+## rotation of a vector about the x-axis by the specified @var{angle}, given in
+## degrees, where a positive angle corresponds to a counterclockwise
 ## rotation when viewing the y-z plane from the positive x side.
 ##
 ## The form of the transformation matrix is:
@@ -51,7 +51,8 @@
 ## @end ifnottex
 ##
 ## This rotation matrix is intended to be used as a left-multiplying matrix
-## when acting on a column vector, using the notation @var{v} = @var{T}@var{u}.
+## when acting on a column vector, using the notation
+## @code{@var{v} = @var{T}*@var{u}}.
 ## For example, a vector, @var{u}, pointing along the positive y-axis, rotated
 ## 90-degrees about the x-axis, will result in a vector pointing along the
 ## positive z-axis:
@@ -81,18 +82,18 @@
 ## @seealso{roty, rotz}
 ## @end deftypefn
 
-function retmat = rotx (angle_in_deg)
+function T = rotx (angle)
 
-  if (nargin < 1 || ! isscalar (angle_in_deg))
+  if (nargin < 1 || ! isscalar (angle))
     print_usage ();
   endif
 
-  angle_in_rad = angle_in_deg * pi / 180;
+  angle *= pi / 180;
 
-  s = sin (angle_in_rad);
-  c = cos (angle_in_rad);
+  s = sin (angle);
+  c = cos (angle);
 
-  retmat = [1 0 0; 0 c -s; 0 s c];
+  T = [1 0 0; 0 c -s; 0 s c];
 
 endfunction
 
--- a/scripts/geometry/roty.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/geometry/roty.m	Tue Oct 13 23:19:09 2020 -0700
@@ -51,7 +51,8 @@
 ## @end ifnottex
 ##
 ## This rotation matrix is intended to be used as a left-multiplying matrix
-## when acting on a column vector, using the notation @var{v} = @var{T}@var{u}.
+## when acting on a column vector, using the notation
+## @code{@var{v} = @var{T}*@var{u}}.
 ## For example, a vector, @var{u}, pointing along the positive z-axis, rotated
 ## 90-degrees about the y-axis, will result in a vector pointing along the
 ## positive x-axis:
@@ -81,18 +82,18 @@
 ## @seealso{rotx, rotz}
 ## @end deftypefn
 
-function retmat = roty (angle_in_deg)
+function T = roty (angle)
 
-  if (nargin < 1 || ! isscalar (angle_in_deg))
+  if (nargin < 1 || ! isscalar (angle))
     print_usage ();
   endif
 
-  angle_in_rad = angle_in_deg * pi / 180;
+  angle *= pi / 180;
 
-  s = sin (angle_in_rad);
-  c = cos (angle_in_rad);
+  s = sin (angle);
+  c = cos (angle);
 
-  retmat = [c 0 s; 0 1 0; -s 0 c];
+  T = [c 0 s; 0 1 0; -s 0 c];
 
 endfunction
 
--- a/scripts/geometry/rotz.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/geometry/rotz.m	Tue Oct 13 23:19:09 2020 -0700
@@ -51,7 +51,8 @@
 ## @end ifnottex
 ##
 ## This rotation matrix is intended to be used as a left-multiplying matrix
-## when acting on a column vector, using the notation @var{v} = @var{T}@var{u}.
+## when acting on a column vector, using the notation
+## @code{@var{v} = @var{T}*@var{u}}.
 ## For example, a vector, @var{u}, pointing along the positive x-axis, rotated
 ## 90-degrees about the z-axis, will result in a vector pointing along the
 ## positive y-axis:
@@ -81,18 +82,18 @@
 ## @seealso{rotx, roty}
 ## @end deftypefn
 
-function retmat = rotz (angle_in_deg)
+function T = rotz (angle)
 
-  if (nargin < 1 || ! isscalar (angle_in_deg))
+  if (nargin < 1 || ! isscalar (angle))
     print_usage ();
   endif
 
-  angle_in_rad = angle_in_deg * pi / 180;
+  angle = angle * pi / 180;
 
-  s = sin (angle_in_rad);
-  c = cos (angle_in_rad);
+  s = sin (angle);
+  c = cos (angle);
 
-  retmat = [c -s 0; s c 0; 0 0 1];
+  T = [c -s 0; s c 0; 0 0 1];
 
 endfunction
 
--- a/scripts/miscellaneous/computer.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/miscellaneous/computer.m	Tue Oct 13 23:19:09 2020 -0700
@@ -61,9 +61,9 @@
 ## @seealso{isunix, ismac, ispc}
 ## @end deftypefn
 
-function [comp, maxsize, endian] = computer (a)
+function [comp, maxsize, endian] = computer (arch)
 
-  if (nargin == 1 && ! strcmpi (a, "arch"))
+  if (nargin == 1 && ! strcmpi (arch, "arch"))
     error ('computer: "arch" is only valid argument');
   endif
 
--- a/scripts/pkg/private/default_prefix.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/pkg/private/default_prefix.m	Tue Oct 13 23:19:09 2020 -0700
@@ -24,10 +24,11 @@
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {[@var{prefix}, @var{archprefix} =} default_prefix (@var{global_install})
+## @deftypefn {} {[@var{prefix}, @var{archprefix} =} default_prefix (@var{global_install}, @var{desc})
 ## Undocumented internal function.
 ## @end deftypefn
 
+## FIXME: second input "desc" does not appear to be used.
 function [prefix, archprefix] = default_prefix (global_install, desc)
 
   if (global_install)
--- a/scripts/plot/appearance/camlookat.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/plot/appearance/camlookat.m	Tue Oct 13 23:19:09 2020 -0700
@@ -40,7 +40,6 @@
 ## (@pxref{XREFcamtarget,,camtarget}) and camera position
 ## (@pxref{XREFcampos,,campos}) are changed.
 ##
-##
 ## If the argument is a list @var{handle_list}, then a single bounding box for
 ## all the objects is computed and the camera is then adjusted as above.
 ##
--- a/scripts/plot/draw/private/__line__.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/plot/draw/private/__line__.m	Tue Oct 13 23:19:09 2020 -0700
@@ -24,8 +24,8 @@
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{h} =} __line__ (@var{parent}, @dots{})
-## Create line object with parent @var{parent}.
+## @deftypefn {} {@var{h} =} __line__ (@var{hp}, @dots{})
+## Create line object with parent handle @var{hp}.
 ##
 ## Return handle @var{h} to created line objects.
 ## @end deftypefn
--- a/scripts/plot/draw/private/__plt__.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/plot/draw/private/__plt__.m	Tue Oct 13 23:19:09 2020 -0700
@@ -24,7 +24,7 @@
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {} __plt__ (@var{caller}, @var{hparent}, @var{varargin})
+## @deftypefn {} {} __plt__ (@var{caller}, @var{hp}, @var{varargin})
 ## Undocumented internal function.
 ## @end deftypefn
 
--- a/scripts/plot/util/private/__add_default_menu__.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/plot/util/private/__add_default_menu__.m	Tue Oct 13 23:19:09 2020 -0700
@@ -24,10 +24,15 @@
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn  {} {} __add_default_menu__ (@var{hfig})
-## @deftypefnx {} {} __add_default_menu__ (@var{hfig}, @var{hmenu})
+## @deftypefn  {} {} __add_default_menu__ (@var{hf})
+## @deftypefnx {} {} __add_default_menu__ (@var{hf}, @var{hmenu})
+## @deftypefnx {} {} __add_default_menu__ (@var{hf}, @var{hmenu}, @var{htb})
 ## Add default menu and listeners to figure.
 ##
+## @var{hf} is a figure handle.
+## @var{hmenu} is a uimenu handle.
+## @var{htb} is a uitoolbar handle.
+##
 ## All uimenu handles have their @qcode{"HandleVisibility"} property set to
 ## @qcode{"off"}.
 ## @end deftypefn
--- a/scripts/signal/__parse_movargs__.m	Tue Oct 13 22:24:20 2020 -0700
+++ b/scripts/signal/__parse_movargs__.m	Tue Oct 13 23:19:09 2020 -0700
@@ -24,10 +24,12 @@
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{args} =} __parse_movargs__ (@var{varargin})
+## @deftypefn {} {@var{args} =} __parse_movargs__ (@var{caller}, @var{varargin})
 ##
 ## Parse arguments for movXXX functions before passing to @code{movfun}.
 ##
+## The input @var{caller} is a string with the name of the calling function
+## and is used to personalize any error messages.
 ## @seealso{movfun}
 ## @end deftypefn