title: Tangent to the curve
body: <p>I’m new at coding and I have a problem, I would like to draw a program where there is a curve and  but for now I just have the static drawing but I don’t know how to generate a tangent line on the curve thanks to his derivate, as the mouse move…</p>
  
  <pre><code>This is all I have for now
      void draw(){
        background(255);
         noFill();
         stroke(0);
         beginShape();
         for(float a=0; a &lt; TWO_PI; a+=0.01) {
           float r=78;
           float x=sin (a);
           float y=(pow(cos(a),2)/(2-cos(a)))
  </code></pre>
  
  <p>my idea was to make a cursor, that moved by the curve, and every tima generated is own tangent.</p>
  
  <p>THANK YOU SO MUCH !!!!!</p>