ee150_ballSkeleton

# ee150_ballSkeleton - î150_bball.m function ee150_bball...

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

%ee150_bball.m function ee150_bball %---------------------------------- % Constants %---------------------------------- radius = 0.7; % radius of the ball x0 = 0; % position of the center of the ball y0 = 10 + radius; w = 3*pi; % angular velocity (radians/sec.) g = 9.81; % gravitational acceleration constant in m/s %---------------------------------- % Duration of the movie, frames per second, and other values %---------------------------------- duration = 15; framerate = 30; maxframes = duration * framerate + 1; dt = 1/framerate; % delta time between each frame %---------------------------------- % Draw the initial ball, ground, and target %---------------------------------- % to draw the ball we'll have 512 points around the circumference n = 512; % Creates a vector of 512 angles from [0 2*PI] radians to be used % to calculate the points on the circumference of the ball % rotate/spin the ball arg = [0 : 2*pi/n : 2*pi]; % Initial ball circumference X,Y coordinates matrix % We will never change this representation of the ball and just % rotate it for each frame % 8 Rows (1 for each sector) x 512/8 + 1 cols % Extra col => starting point of each sector is 0,0 xi = zeros(8,1+n/8); yi = zeros(8,1+n/8); %=== For LAB completion==== % We'll cut the ball into 8 sectors filling each sector w/ a unique color % To do this, modify the xi, yi matrices such that the 1st point of each

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/07/2011 for the course EE 150 taught by Professor Dr.burke during the Fall '08 term at USC.

### Page1 / 3

ee150_ballSkeleton - î150_bball.m function ee150_bball...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online