Circle_cap coding in matlab

14 Views Asked by At

I would like to write a code to plot a circle cap like the shape below.

enter image description here

In fact, $r,\; \theta$ and $a$ are given and I want to plot it using them. Note: It is not difficult to see that $a=r\sin \theta$. Also, you can consider the center of the circle $(r\cos \theta,0)$.