<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/6268/">http://svn.reviewboard.kde.org/r/6268/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 3rd, 2011, 10:06 p.m., <b>Aleix Pol</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Regarding explicit plots, as I said to you I think it&#39;s good to stick with symbolic derivation because it highlights the missing features. Note that the printed slope is just visual sugar but not any extracted information.
That leads to my next point: it makes no sense to add the new interface to function.h, the slope should be given 1 point, not an interval. You&#39;re extracting it from the last mouse position, that&#39;s not what we are providing semantically.

If the only way to provide a slope for implicit plots is to draw a line across the two closer points, that should be done in functionimplicit.cpp exclusively. (you can get the last position received by saving it in ::calc, for instance)</pre>
 </blockquote>




 <p>On January 3rd, 2011, 11:54 p.m., <b>Percy Camilo Triveño Aucahuasi</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">As you say, the same idea behind the patch could be apply only on functionimpl*, what I&#39;m saying is that is not necesary to have a high and complex way to do this &quot;visual suguar&quot;, if we can do this with less operations, fastter and more robust, then there is no need to stick to the idea to calculate the derivatives and employ numerical methods instead a couple of operactiones.

Please note that with polar and parametric curves will be more difficult to draw a tangent line using derivatives, it would be more easy and fast through a geometrically approach ... this isn&#39;t an improvement only for implicit curves, but all the plane curves.

If is need it, I can try to port the same patch on functionimpl*, in any case isn&#39;t a matter of where to place this code, we can work on this subject ;)

Percy

</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Cheking the commit 1211414, the method to draw tangents using derivatives is still default and the code of this patch has been ignored, now the geometrically approach is a fallback method in case derivative fails ... this wasn&#39;t the intention of the proposal, however I understand the need of doing some tasks analitically, I guess is ok to close this review, 

What say you Aleix?

http://websvn.kde.org/?view=revision&amp;revision=1211414

  </pre>
<br />








<p>- Percy Camilo</p>


<br />
<p>On January 3rd, 2011, 9:14 p.m., Percy Camilo Triveño Aucahuasi wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDE-Edu, Aleix Pol and Percy Camilo Triveño Aucahuasi.</div>
<div>By Percy Camilo Triveño Aucahuasi.</div>


<p style="color: grey;"><i>Updated 2011-01-03 21:14:26</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Currently KAlgebra needs to calculate the derivative of the function for draw its tangent line, this calculation is done each time the mouse is moving inside the 2d area. The drawbacks for this method are:

- KAlgebra can&#39;t draw the tangent on any case, becouse the parser doesn&#39;t know how to calculate the derivative for all types of functions and operators.
- The derivative of many functions can&#39;t be calculated becouse the function could have a singular point or may be non-smooth. 
- This approach need to use numerical methods, so the complexity (and time) for such a simple task like draw the tangent, is the combination of 2 opperations: calculate the derivative and apply a numerical method to find the tangent ... if the derivative fails then the numerical method will fail.
- Fails for implicit curves.

This patch made possible to calculate the line tangent by a simple geometric method, the pros over the current state are:

- It works on any case, even if the parser can&#39;t obtain/evaluate the derivative. 
- Doesn&#39;t need numerical methods.
- The complexity and the time would be: two subtractions and one division ... 
- It works for implicit curves or even if the function have a singular point or isn&#39;t smooth.

This patch doesn&#39;t add new features but improves the behaviour and scope of KAlgebra ;)

Cheers,
Percy ;)

</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">(x, y)-&gt;x-y^sin(y)
power(x, sin(x))</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/function.h <span style="color: grey">(1211228)</span></li>

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/function.cpp <span style="color: grey">(1211228)</span></li>

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/functionimpl.h <span style="color: grey">(1211228)</span></li>

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/functionimpl.cpp <span style="color: grey">(1211228)</span></li>

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/functionsmodel.h <span style="color: grey">(1211228)</span></li>

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/functionsmodel.cpp <span style="color: grey">(1211228)</span></li>

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/graph2d.h <span style="color: grey">(1211228)</span></li>

 <li>/trunk/KDE/kdeedu/kalgebra/analitzagui/graph2d.cpp <span style="color: grey">(1211228)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/6268/diff/" style="margin-left: 3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Screenshots </h1>

<div>

 <a href="http://svn.reviewboard.kde.org/r/6268/s/601/"><img src="http://svn.reviewboard.kde.org/media/uploaded/images/2011/01/03/tangent-for-implict-curve_400x100.png" style="border: 1px black solid;" alt="implicitcurve" /></a>

</div>


  </td>
 </tr>
</table>








  </div>
 </body>
</html>