{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

StickOnWheelAnim - function out = StickOnWheelAnim(In Prof...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
function out = StickOnWheelAnim(In) % Prof Ka C Cheok for EE/SYS4/575 Mechatronics class 3 Oct 2005 % global FigHandle global BallShape BallHandle BallShapeOnes global WheelShape WheelHandle WheelShapeOnes global StickShape StickHandle StickShapeOnes g MS = In(1); IS = In(2); RS = In(3); MW = In(4); IW = In(5); RW = In(6); L = In(7); Df = In(8); Dh = In(9); ThetaS = In(10); ThetaW = In(11); T %---------------------------------------------------------------------------------- ---- % INITIALIZE GRAPHICS %---------------------------------------------------------------------------------- ---- % Check whether the 3D graphic figure already exists if isempty(FigHandle), FigHandle = figure; end; % Start a new figure if there is no handle yet. set(gcf,'position',[10 200 800 400]); if sum(get(FigHandle,'name')) ~= sum('Stick On Wheel'), %% DRAW GRAPHICS for the FIRST TIME ONLY StickShape = [[RW*ThetaW+RW*sin(ThetaS) RW*ThetaW+L*sin(ThetaS)- RS*sin(ThetaS)];... [RW+RW*cos(ThetaS) RW+L*cos(ThetaS)-RS*cos(ThetaS)]]; StickHandle = plot(StickShape(1,:),StickShape(2,:)); set(StickHandle,'erasemode','xor','linewidth',3,'color','y') hold on; UnitCircle=linspace(0,2*pi,20); WheelShape = RW*[cos(UnitCircle) ; sin(UnitCircle)]; WheelShapeOnes = ones(1,max(size(WheelShape)));
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}