

* sin ( angles_L_wheel ) % rhodonea curve reducedRGBimage = uint8 ( ones ( xSize, ySize, 3, nFrames )) % allocate for iFrame = 1 : nFrames cla ( axesHandle ) drawSpurWheel ( center_L_wheel, teeth ( 1 ), module, RGB. * cos ( angles_L_wheel ) % rhodonea curve xCurvePoints = curveAmplitude * cos ( k * angles_L_wheel ).
#XLINE MATLAB MANUAL#
% repeat as often as possible for nice antialiasing floor ( screenSize ( 4 ) / ySize ), floor ( screenSize ( 3 ) / xSize )) if scaleReduction = 0 error ( '"MegaPixelTarget" not possible use smaller target or bigger monitor' ) end % check figPos = % big start image for antialiasing later set ( figHandle, 'Position', figPos ) if ~ all ( get ( figHandle, 'Position' ) = figPos ) error ( 'figure Position could not be set' ) end % check liSc = ySize * scaleReduction / 600 % LineWidth scale LineWidth is absolut, a bigger images needs thicker lines to keep them in proportion axis equal setXYlim ( axesHandle, xLimits, yLimits ) % reset limits and drawnow angles_R_wheel = - angles_L_wheel * k if n = 4 angles_R_wheelToothAllign = angles_R_wheel + pi / teeth ( 2 ) % ALLIGNMENT THIS MAY NEED MANUAL ADJUSTMENT else angles_R_wheelToothAllign = angles_R_wheel % ALLIGNMENT THIS MAY NEED MANUAL ADJUSTMENT end 圜urvePoints = curveAmplitude * cos ( k * angles_L_wheel ).
#XLINE MATLAB FULL#
* module % % continuous rotation % nFrames = 180*max(d,n) % 180 frames per rotation % angles_L_wheel = linspace(0, d *2*pi,nFrames) % angles for wheel responsible for Up-Down % angles_L_wheel = angles_L_wheel(1:end-1) % remove last frame, it would be double % stop acc rot deacc stop accFrames = 10 % frames for acceleration (first frame will be 0 last at full speed, so practicall it is accFrames-2) nFrames = 180 * max ( d, n ) + 2 * accFrames % 180 frames per rotation speed = speed = speed ( 1 : end - 1 ) % last speed is 0, this does nothing in cumsum (compensated by +1 frames in center) angles_L_wheel = cumsum ( speed ) / sum ( speed ) * d * 2 * pi % create position, normalize, scale angles_L_wheel ( end ) = 0 % repalce "d*2*pi" with 0 to avoid rounding errors resulting in minimally crooked lines center_L_wheel = % wheel for left movement center_R_wheel = % wheel for right movement curveAmplitude = 0.43 * diameter ( 1 ) if strcmp ( curVers, 'n1_d1' ) xLimits = % ADJUST else xLimits = % ADJUST end yLimits = * diameter ( 1 ) % ADJUST xRange = xLimits ( 2 ) - xLimits ( 1 ) yRange = yLimits ( 2 ) - yLimits ( 1 ) screenSize = get ( groot, 'Screensize' ) - % (minus tolerance for figure borders) imageAspectRatio = xRange / yRange MegaPixelTarget = 100 * 10^ 6 % Category:Animated GIF files exceeding the 100 MP limit pxPerImage = MegaPixelTarget / nFrames % pixel per gif frame ySize = sqrt ( pxPerImage / imageAspectRatio ) % gif height xSize = ySize * imageAspectRatio % gif width xSize = floor ( xSize ) ySize = floor ( ySize ) % full pixels scaleReduction = min (. white ) % white background axesHandle = axes hold ( axesHandle, 'on' ) axis equal axis off % invisible axes (no ticks) drawnow for versionNr = 1 : size ( versionList, 1 ) curVers = % 'n1_d1' n = versionList ( versionNr, 1 ) d = versionList ( versionNr, 2 ) k = n / d teeth = % use "highly composite number" teeth ( 2 ) = teeth ( 1 ) / k if teeth ( 2 ) ~= round ( teeth ( 2 )) error ( curVers ) end diameter = teeth.
#XLINE MATLAB FREE#
% see ] module = 1 % gear size = fileparts ( which ( mfilename )) % save files under the same name and at file location figHandle = figure ( 15554461 ) clf set(figHandle,'Units','pixel') set ( figHandle, 'MenuBar', 'none', 'ToolBar', 'none' ) % free real estate for a maximally large image set ( figHandle, 'Color', RGB.

darkGrey = % coordinate system RGB = structfun q ) round ( q * 255 ) / 255, RGB, 'UniformOutput', false ) % round to values that are nicely uint8 compatible versionList = 1 1. % % After rendering the first frame gets a display time of 0.4 sec and % the last frame of 2 sec (using "Jasc Animation Shop").

% The plot option "GraphicsSmoothing" made this partly redundant. % This allows the rendering of bigger base images, % and therefor better (self made) antialiasing. % The image is rendered horizontally, but saved rotated vertical. X = cos ( n d θ ) cos ( θ ), y = cos ( n d θ ) sin ( θ ) įunction = Rose_Curve_animation_with_Gears () % The shape of the gears is not precise, it creates a decent GIF and a SVG. Deutsch: Rosette erstellt mit Zahnrädern.ĭie Figur ergibt sich aus dem Übersetzungsverhältnis zwischen dem oberen und dem unteren Rad.
