From octave-sources-request at bevo dot che dot wisc dot edu Mon Jan 27 14:07:10 2003 Subject: Octave routines for unit conversions. - deg2rad.m From: Stefan Burger To: octave-sources at bevo dot che dot wisc dot edu Date: Mon, 27 Jan 2003 07:44:19 -0600 --------------Boundary-00=_LTKD5GDXUJBKGQ8SXA2O Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Some more functions that I want to contribute.=20 I often use octave as sort of an engineers calculator,=20 and these routines have quite often served me well.=20 Could not find a suitable category for these files,=20 would suggest placing them into miscellaneous, or=20 create category units. Files that will follow: * Converting angles: =09deg2rad =09(attached) =09rad2deg * Converting temperatures: =09cels2fahr =09cels2kelv =09fahr2cels =09fahr2kelv =09kelv2fahr =09kelv2cels * Converting lenght=20 =09len2metric =09metric2len * Converting areas =09area2metric =09metric2area * Converting volumes =09vol2metric =09metric2vol * Converting weights =09mass2kg =09kg2mass * Converting forces =09lbf2N =09N2lbf Hoping that others will find them useful, too.=20 Best regards,=20 Stefan Burger. --------------Boundary-00=_LTKD5GDXUJBKGQ8SXA2O Content-Type: text/plain; charset="us-ascii"; name="deg2rad.m" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="deg2rad.m" ## Copyright (C) 2003 Stefan Burger ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 2, or (at your option) any ## later version. ## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, write to the Free ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. ## -*- texinfo -*- ## at deftypefn {Function File} {} deg2rad (@var{angle_d}) ## Converts an anglular value in degrees at var{angle_d} to an angular value ## in radians. ## Input can be scalar, vector or a matrix. ## Conversion is done elementwise on the input. ## The returned value is of the same size as the input. ## at end deftypefn ## at seealso{rad2deg} ## Author: Stefan Burger ## Description: converts angles degrees to radians. function angle_r = deg2rad (angle_d) if (nargin != 1) usage("deg2rad (angle_d)"); endif angle_r = angle_d * (pi/180); endfunction --------------Boundary-00=_LTKD5GDXUJBKGQ8SXA2O--