![]() ![]() ![]() * firstRatio anglesFast = anglesFast + ( 2 * pi / teeth ( 1 )) * 0.5 % ALLIGNMENT THIS MAY NEED MANUAL ADJUSTMENT case 3 % animated_internal_gear saveName = 'animated_internal_gear' nFrames = 80 teeth = module = % gear size diameter = module. * secondRatio anglesMedium = anglesMedium + ( 2 * pi / teeth ( 2 )) * 0.5 % ALLIGNMENT THIS MAY NEED MANUAL ADJUSTMENT firstRatio = teeth ( 2 ) / teeth ( 1 ) anglesFast = anglesMedium. * teeth center1 = center2 = center3 = xLimits = % use a rim of size "module(1)" yLimits = % use a rim of size "module(1)" maxMovementOfTheSlowestTooth = 2 * pi / teeth ( 3 ) anglesSlow = linspace ( 0, maxMovementOfTheSlowestTooth, nFrames + 1 ) anglesSlow = anglesSlow ( 1 : end - 1 ) % remove last frame, it would be double secondRatio = teeth ( 3 ) / teeth ( 2 ) anglesMedium = anglesSlow. * firstRatio anglesFast = anglesFast + ( 2 * pi / teeth ( 1 )) * 0.5 % ALLIGNMENT THIS MAY NEED MANUAL ADJUSTMENT case 2 % animated_3_Gear_Row saveName = 'animated_3_Gear_Row' nFrames = 80 teeth = module = % gear size diameter = module. * secondRatio anglesMedium = anglesMedium + ( 2 * pi / teeth ( 3 )) * 0.5 % ALLIGNMENT THIS MAY NEED MANUAL ADJUSTMENT firstRatio = teeth ( 2 ) / teeth ( 1 ) anglesFast = anglesMedium. * teeth center1 = center2 = center3 = xLimits = % use a rim of size "module(1)" yLimits = % use a rim of size "module(1)" maxMovementOfTheSlowestTooth = 2 * pi / teeth ( 4 ) anglesSlow = linspace ( 0, maxMovementOfTheSlowestTooth, nFrames + 1 ) anglesSlow = anglesSlow ( 1 : end - 1 ) % remove last frame, it would be double secondRatio = teeth ( 4 ) / teeth ( 3 ) anglesMedium = anglesSlow. bkgd ) % white background axesHandle = axes hold ( axesHandle, 'on' ) axis off % invisible axes (no ticks) axis equal for currentCase = 3 : 8 switch currentCase case 1 % animatedGears saveName = 'animatedGears' nFrames = 240 teeth = module = % gear size diameter = module. red = % % violetRGB = % RGB = structfun q ) round ( q * 255 ) / 255, RGB, 'UniformOutput', false ) % round to values that are nicely uint8 compatible figHandle = figure ( 15674459 ) clf set(figHandle,'Units','pixel') set ( figHandle, 'MenuBar', 'none', 'ToolBar', 'none' ) % free real estate for a maximally large image set ( figHandle, 'Color', RGB. ![]() % % Jahobr = fileparts ( which ( mfilename )) % save files under the same name and at file location RGB. Function animatedGears () % Source code for drawing gears % The shape of the gears is not precise, it creates a decent GIF and a SVG. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |