# Matlab Math Help

Consider the curve traced by a point on the rim of a circle rolling along a straight line, a cycloid. If the cycloid were drawn in the xy-plane, then it could be described by the following position vector:

                       c(t)=(t-sin(t))i + (1-cos(t))j


Using MATLAB, how would i plot a cycloid for $0 \leq t \leq 6\pi$? How would i then find the velocity c'(t) of the moving point which traces the cycloid? I assume this could also be found using MATLAB but i have always been a bit rough with MATLAB expressions/inputs/etc. Lastly, is there a tool i could use to read off the graph to help find the exact length of a single arc?

Any help would be appreciated!! thanks! :)

t = 0:0.01:6*pi;

X = t-sin(t);

Y = 1-cos(t);

plot(X,Y)

In this particular case, the velocity can be computed analytically

X_prime = 1 -cos(t)

Y_prime = sin(t)

And you can obtain length of the arc by summing $\frac{6\pi}{|T|}\sum_{t \in T}\Arrowvert c'(t) \Arrowvert_2$ (as we have a very fine grid, this sum is closed to the integral)

length = 6*pi*mean(sqrt(X_prime.^2+Y_prime.^2)