Bug 316693

Summary: numerical instability in intersection between a line perpendicular to directrix and a parabola
Product: [Applications] kig Reporter: Maurizio Paolini <maurizio.paolini>
Component: generalAssignee: David E. Narvaez <david.narvaez>
Status: RESOLVED FIXED    
Severity: minor    
Priority: LO    
Version: v1.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
URL: http://dmf.unicatt.it/~paolini/kig/bugs/bugparabola.kig
Latest Commit: Version Fixed In: 4.10.3
Attachments: possible patch, but little discussion needed

Description Maurizio Paolini 2013-03-13 22:50:15 UTC
numerical instability when intersecting a line and a parabola when the line is parallel to the axis of the parabola

Reproducible: Sometimes

Steps to Reproduce:
1. construct a vertical parabola, 
2. then its directrix,
3. a perpendicular line through a point constrained on the directrix, 
4. intersect this line with the parabola.
Sometimes, moving the constrained point shows garbage in kig window that disappears when motion finishes
Actual Results:  
Sometimes, moving the constrained point shows garbage in kig window that disappears when motion finishes

Expected Results:  
A fluid motion of the involved objects

url above provides a save file that produces the issue.
After loading the file it is necessary to repeatedly zoom around the origin to
actually see the construction.  This is a hint that the problem is caused by
the existence of the "point at infinity" clearly due to rounding errors.
Comment 1 David E. Narvaez 2013-03-14 05:40:23 UTC
Thanks for the bug report, I'm taking a look at it now.
Comment 2 Maurizio Paolini 2013-03-14 07:32:23 UTC
Created attachment 78054 [details]
possible patch, but little discussion needed

Here is a possible patch... However it entails the choice of a threshold, which should be discussed.
Comment 3 Maurizio Paolini 2013-04-03 17:08:27 UTC
Can I (try to) commit the patch for this problem?
Comment 4 David E. Narvaez 2013-04-03 18:10:46 UTC
Hi, sorry I didn't get back to you earlier. I wanted to propose a different approach to the fix but it won't be possible to implement that until 4.11 at least, so yes, please commit your fix to the 4.10 branch.
Comment 5 Maurizio Paolini 2013-04-03 18:25:34 UTC
committed:
http://commits.kde.org/kig/4e5500d9fc188eca2eb00cc102cecdab5b3c4955
Comment 6 David E. Narvaez 2013-04-04 13:30:06 UTC
Git commit 07d2f651014256d4855d4fcb694ec10028266d2c by David E. Narváez.
Committed on 04/04/2013 at 15:45.
Pushed by narvaez into branch 'KDE/4.10'.

Test for point at infinity

Cherry-picked from 4e5500d9fc188eca2eb00cc102cecdab5b3c4955
FIXED-IN: 4.10.3

M  +4    -0    misc/conic-common.cpp

http://commits.kde.org/kig/07d2f651014256d4855d4fcb694ec10028266d2c