1 /**********************************************************************
3 FILENAME: uiuc_find_positon.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: Determine the position of a surface/object given the
8 command, increment rate, and current position. Outputs
11 ----------------------------------------------------------------------
15 ----------------------------------------------------------------------
19 ----------------------------------------------------------------------
21 HISTORY: 03/03/2003 initial release
23 ----------------------------------------------------------------------
25 AUTHOR(S): Robert Deters <rdeters@uiuc.edu>
26 Michael Selig <m-selig@uiuc.edu>
28 ----------------------------------------------------------------------
32 ----------------------------------------------------------------------
34 INPUTS: command, increment rate, position
36 ----------------------------------------------------------------------
40 ----------------------------------------------------------------------
42 CALLED BY: uiuc_aerodeflections()
44 ----------------------------------------------------------------------
48 ----------------------------------------------------------------------
50 COPYRIGHT: (C) 2003 by Michael Selig
52 This program is free software; you can redistribute it and/or
53 modify it under the terms of the GNU General Public License
54 as published by the Free Software Foundation.
56 This program is distributed in the hope that it will be useful,
57 but WITHOUT ANY WARRANTY; without even the implied warranty of
58 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59 GNU General Public License for more details.
61 You should have received a copy of the GNU General Public License
62 along with this program; if not, write to the Free Software
63 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
64 USA or view http://www.gnu.org/copyleft/gpl.html.
66 **********************************************************************/
67 #include "uiuc_find_position.h"
69 double uiuc_find_position(double command, double increment_per_timestep,
72 if (position < command) {
73 position += increment_per_timestep;
74 if (position > command)
77 else if (position > command) {
78 position -= increment_per_timestep;
79 if (position < command)