Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order to plot the piecewise function in MATLAB, we had to create logic to tell the computer what which function in the piecewise function to use. We realize that the piecewise function could be solely dependent on the length of the second slider (L6) to distinguish which function to use. In every iteration of the code, all three scenarios were calculated. Then conditions were checked for if the functions yielded a radius below or over the constant radius determined beforehand. Based on this constant radius, only one function would have solutions that would make sense and a simple if statement was used to choose the correct one. The code can be seen in Appendix A. Finally, after plotting theta going from 0 to 360 degrees, we obtained the following demonstration:

...