The goal of this project is to calculate and animate the trajectory of a dart thrown at a dartboard that will miss somewhat randomly from a selected aiming location. The project uses a
This project is an extension of a Dartbot program written in
The
R CMD BATCH [options] infile [outfile]
Where one of the options is '--args arg1 arg2'
. In this case, arg1 and arg2 are
Note: R must be installed on your computer to execute this command (Download here).
Because the output file generated by
It is very difficult to accurately model the error in throwing a dart because of various outside factors.
The board is first represented with polar coordinates, an instinctive choice given the board is a circle. In the simulation, angle
To find the error in radius
The same process is repeated for error in angle
The
The figure above shows a contour plot of the probability density function (bivariate normal distribution) that effectively appears above the T20 bed when the computer difficulty is set to $50%, where the highest probability is above the origin of the plot, the exact center of the bed. The dashed boundary lines indicated the boundaries of the T20 bed relative to the center,
The final function in
Originally, the world was written
The dartboard itself is a
The
The
Note: In the X3D world, the positive
The trajectory of the dart is governed parametrically, where the parameter
The value of
Next, Simulink's integrator blocks are used to work with velocities. Initial conditions must be specified here. Because the dart must travel exactly
In calculating
In order to mimic gravity and create a parabolic trajectory with the estimated gravity value,
The final step is to calculate position. Note the initial position of the dart is
Finally,
Here is a video of the animation where the computer aims at the Triple 20 bed (the red bed directly above the center of the board):
dartVideo.mp4
Darts/ ├── MATLAB/ │ ├── DartsModel.slx │ ├── dartsRProg.R │ └── runRScript.m └── 3D Environment/ ├── dartWorldX3D.x3d ├── dartboardPNG.png └── Fire.png
To run this project,
Thank you to Professor Cipolli at Colgate University for allowing use of his
© 2024. This work is openly licensed via CC BY 4.0