📈

Exploring Parametric Curves with MATLAB

Sep 9, 2024

Lecture on Parametric Curves and MATLAB

Introduction to Parametric Curves

  • Also known as vector-valued functions.
  • Explore using MATLAB for visualization.
  • Not part of APS-C 171 curriculum, but useful for programming experience.

MATLAB Introduction

  • MATLAB is free for Queen's students.
  • Download via ITS software center.

Running a MATLAB Script

  • Initial example involves plotting using cos(t) and sin(t).
  • Use of axis equal command to maintain equal proportions on x and y axes.
  • Example produces a circle by plotting parametric equations.

Understanding MATLAB Code

  • Define range for t from 0 to 2Ï€ with a step of 0.01.
  • Plot with cos(t) for x-values and sin(t) for y-values.
  • Demonstrates creating a smooth circle.

Animation in MATLAB

  • Aims to show trajectory over time.
  • Use of a for loop to iterate over time values.
  • Plotting individual points over time to demonstrate movement.

Improving Visibility in MATLAB

  • Change marker size to make points visible.
  • Use close all to reset graphics windows.
  • drawnow command enables animation effect.
  • Control plot window visibility and order with plotting commands.

Enhancing Animation

  • Use CLF to clear figure and hold on to retain previous plots.
  • Plot entire trajectory with a distinct path and moving dot.
  • Adjust speed by changing time point intervals (e.g., every 10th point).
  • Demonstrate multiple loops around the circle by extending t range.

Concepts of Parametric Graphing

  • Difference from traditional xy graphs: involves time as a parameter.
  • Each point on the graph relates to a specific time value.
  • Important to consider direction of travel and maximum reach in x and y as functions of time.
  • Relevant for interpreting particle trajectories.