Code covered by the BSD License
-
[width,height,x0,y0,v0,th,mu,...
This is the User Input Section of the (Billiard Table) program
-
billiard(manual_input)
-
tf=time_to_impact(width,heigh...
-
th=theta_impact(th,width,heig...
% This function recalculates the value of (Theta) depending on the impact
-
test_billiard.m
-
View all files
from
Billiard Ball Animation
by Fahad Al Mahmood
This program animates the movement of a billiard ball.
|
| test_billiard.m |
% CASE(1)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;width=100;height=100;x0=40;y0=60;v0=100;th=120;mu=0.1;e=0.1;t_int=0.1;FILE='data_1';
manual_input=0,billiard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CASE(2)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;width=100;height=100;x0=30;y0=40;v0=1000;th=0;mu=0.5;e=0.8;t_int=0.1;FILE='data_2';
manual_input=0,billiard;
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CASE(3)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;width=200;height=100;x0=5;y0=5;v0=100;th=210;mu=0;e=1;t_int=0.1;FILE='data_3';
manual_input=0,billiard
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
Contact us at files@mathworks.com