[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu
Subject:    Re: Review Request 127364: improving CircleCircleIntersection (towards what geogebra does)
From:       Maurizio Paolini <paolini () dmf ! unicatt ! it>
Date:       2016-04-03 21:01:15
Message-ID: 20160403210115.8263.85562 () mimi ! kde ! org
[Download RAW message or body]

--===============2444027532040499363==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127364/
-----------------------------------------------------------

(Updated April 3, 2016, 9:01 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Edu, David Narváez and Rex Dieter.


Repository: kig


Description
-------

I am addressing two related issues: intersection points that jump, circles \
degenerating to lines. When intersecting circles obtained as "circle by 3 points" it \
is possible that one or both degenerate into a straight line.  At present when \
dinamically moving one of the three defining points of a circle across the line \
through the other two, the two intersection points exchange position, possibly \
causing the subsequent constructions to change abruptly. The other related issue is \
that at the moment the intersection point is not defined when one of the two circles \
degenerate into a line.

Motivation: this situations naturally arise, for example, when trying to construct \
the Disk Poincare' model of the hyperbolic plane, in which case it is essential to \
allow for circles to become lines.

A sample kig file that exposes these issues is available as \
http://dmf.unicatt.it/~paolini/kig/bugs/test_circle_intersection_old.kig

The big black points can be moved across the other two defining one of the two \
circles, observe that the two intersection points exchange position.  Moreover, if a \
black point is precisely aligned with the other two (press the shift key to force the \
point onto the grid), then the two intersection points disappear.


Diffs
-----

  misc/common.cpp 2e1fac9 
  objects/arc_type.h a9a7296 
  objects/arc_type.cc 26c05cc 
  objects/circle_imp.h dc63e06 
  objects/circle_imp.cc 7450ef6 
  objects/circle_type.h 37cf400 
  objects/circle_type.cc 25ec233 
  objects/intersection_types.cc 2fd07be 
  objects/other_imp.h 31feda6 
  objects/other_imp.cc d773196 

Diff: https://git.reviewboard.kde.org/r/127364/diff/


Testing
-------

Unfortunately, to address the "abrupt intersection points exchange" it seems \
necessary to add a (hidden) circle orientation for CircleImp(s).  In the proposed \
patch this is achieved by allowing the "mradius" member to be negative (it is \
"private", so that we to not risk to expose this possibility; radius() method will \
now return the absolute value of mradius, and the new "orientation()" method returns \
the circle orientation).

The additional 'orientation' information can then be used inside the \
CircleCircleIntersection::calc to avoid the abrupt jump of the intersection points.

The new CircleBTPoType class constructs an "oriented" circle (note that the user will \
not be able to directly access the orientation information), whereas the old \
CircleBTPType is left unchanges.  CircleBTPoType substitutes CircleBTPType in \
builtin_stuff.cc. In this way we ensure backward compatibility for old saved kig \
files, whereas new constructions will take advantage of the orientation.

Alternatively we can simply substitute the present CircleBTP with the new version.


File Attachments
----------------

old behaviour
  https://git.reviewboard.kde.org/media/uploaded/files/2016/03/13/31028aa6-140d-40c2-9a79-743ed2e10f40__test_circle_intersection_old.kig
 new behaviour
  https://git.reviewboard.kde.org/media/uploaded/files/2016/03/13/526e0448-2b20-454b-ae2a-a5537bb94e99__test_circle_intersection_new.kig
 constructing a locus: before
  https://git.reviewboard.kde.org/media/uploaded/files/2016/03/19/76aca8dd-9f1f-41ff-a2f0-2b1877bd3305__locus_old.png
 constructing a locus: after
  https://git.reviewboard.kde.org/media/uploaded/files/2016/03/19/cef22d67-a58f-49e4-9659-10bf3964fedc__locus_new.png



Thanks,

Maurizio Paolini


--===============2444027532040499363==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit




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



<table bgcolor="#e0e0e0" width="100%" cellpadding="12" style="border: 1px gray solid; \
border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  <tr>
  <td>
   <h1 style="margin: 0; padding: 0; font-size: 10pt;">This change has been marked as \
submitted.</h1>  </td>
 </tr>
</table>
<br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for KDE Edu, David Narváez and Rex Dieter.</div>
<div>By Maurizio Paolini.</div>


<p style="color: grey;"><i>Updated April 3, 2016, 9:01 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kig
</div>


<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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">I am addressing two related issues: intersection \
points that jump, circles degenerating to lines. When intersecting circles obtained \
as "circle by 3 points" it is possible that one or both degenerate into a straight \
line.  At present when dinamically moving one of the three defining points of a \
circle across the line through the other two, the two intersection points exchange \
position, possibly causing the subsequent constructions to change abruptly. The other \
related issue is that at the moment the intersection point is not defined when one of \
the two circles degenerate into a line.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Motivation: this \
situations naturally arise, for example, when trying to construct the Disk Poincare' \
model of the hyperbolic plane, in which case it is essential to allow for circles to \
become lines.</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">A sample kig file that exposes these issues is \
available as http://dmf.unicatt.it/~paolini/kig/bugs/test_circle_intersection_old.kig</p>
 <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">The big black points can be moved across the other two \
defining one of the two circles, observe that the two intersection points exchange \
position.  Moreover, if a black point is precisely aligned with the other two (press \
the shift key to force the point onto the grid), then the two intersection points \
disappear.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Unfortunately, to address the "abrupt intersection \
points exchange" it seems necessary to add a (hidden) circle orientation for \
CircleImp(s).  In the proposed patch this is achieved by allowing the "mradius" \
member to be negative (it is "private", so that we to not risk to expose this \
possibility; radius() method will now return the absolute value of mradius, and the \
new "orientation()" method returns the circle orientation).</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The \
additional 'orientation' information can then be used inside the \
CircleCircleIntersection::calc to avoid the abrupt jump of the intersection \
points.</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">The new CircleBTPoType class constructs an "oriented" \
circle (note that the user will not be able to directly access the orientation \
information), whereas the old CircleBTPType is left unchanges.  CircleBTPoType \
substitutes CircleBTPType in builtin_stuff.cc. In this way we ensure backward \
compatibility for old saved kig files, whereas new constructions will take advantage \
of the orientation.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">Alternatively we can simply substitute \
the present CircleBTP with the new version.</p></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>misc/common.cpp <span style="color: grey">(2e1fac9)</span></li>

 <li>objects/arc_type.h <span style="color: grey">(a9a7296)</span></li>

 <li>objects/arc_type.cc <span style="color: grey">(26c05cc)</span></li>

 <li>objects/circle_imp.h <span style="color: grey">(dc63e06)</span></li>

 <li>objects/circle_imp.cc <span style="color: grey">(7450ef6)</span></li>

 <li>objects/circle_type.h <span style="color: grey">(37cf400)</span></li>

 <li>objects/circle_type.cc <span style="color: grey">(25ec233)</span></li>

 <li>objects/intersection_types.cc <span style="color: grey">(2fd07be)</span></li>

 <li>objects/other_imp.h <span style="color: grey">(31feda6)</span></li>

 <li>objects/other_imp.cc <span style="color: grey">(d773196)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/127364/diff/" style="margin-left: \
3em;">View Diff</a></p>



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


 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/03/13/31028aa6-140d-40c2-9a79-743ed2e10f40__test_circle_intersection_old.kig">old \
behaviour</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/03/13/526e0448-2b20-454b-ae2a-a5537bb94e99__test_circle_intersection_new.kig">new \
behaviour</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/03/19/76aca8dd-9f1f-41ff-a2f0-2b1877bd3305__locus_old.png">constructing \
a locus: before</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/03/19/cef22d67-a58f-49e4-9659-10bf3964fedc__locus_new.png">constructing \
a locus: after</a></li>

</ul>




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



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


--===============2444027532040499363==--


[Attachment #3 (text/plain)]

_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic