The gear scripts are Matlab scripts to create curves for involute gears. These scripts create an x-y path for gears given the diametric pitch series, pitch angle, number of teeth, gear height, and a few other characteristics. My main reference for creating these gears is the Machinery Handbook pg 1995 to 2010, and the McMaster Carr catalog (which has examples for different pitch series).  .
Spur gears are typically based on involute curves. The contact point between two involute gears moves along a straight line of action between two base circles. This construction line is inclined at an angle called the gear pitch angle. An involute gear can also drive another involute gear, with both rotating at a uniform rate, even though the center-to-center distance is varied.
In order to mesh, gears must have the same pitch angle. They must also be part of the same diametrical pitch series. (Diametrical pitch is the number of teeth on a gear of a certain reference diameter (# teeth for 1" diameter for ANSI)).
References: Oberg, Eric, FD Jones, HL Horton, and HH Ryffel. Machinery Handbook. Industrial Press, 1992.
LICENSE: BSD License
Copyright (c) 2015, Aaron M. Schinder All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.