Conic Scaling Bug?

Thijs shared this problem 9 years ago
Answered

Hi,


I'm really surprised by the inaccuracy and disappearance of certain conics when zooming in with factors that are not very large/small. I'm talking about zoom factors in the order of 0.01.


In the past I used "Compass and Ruler". (http://en.wikipedia.org/wiki/C.a.R.)

Recently I started using GeoGebra because it has much more to offer.

I tried my examples in "Compass and Ruler" but found no problems there.

Therefore, I think it's a bug in GeoGebra.


I found a remark in the javasource "GeoConicND.java":


/** avoid very large and small coefficients for numerical stability */

protected static final double MAX_COEFFICIENT_SIZE = 100000;


Unfortunately I'm no expert on java so I can't get a quick read from the sources.

Therefore, I give some examples of things that surprise me and I hope that my findings are relevant.


I am using:


GeoGebra 4.4.5.0

Windows 7

Java: Version 7 Update 45 (build 1.7.0_45-b18).

======================================================================


My first remark is that certain conics don't pass through points which they should do.

I'm giving an example (See attached file and press Zoom-button):


Short description of relevant construction steps.

Create conic through 5 points (Aconic).

Zoomin and see that conic doesn't pass through (0,0).

An intersection from a line with the conic stays in correct place.


A0=(0, 0)

A1=(2, 4)

A2=(6, 4)

A3=(8, 0)

A4=(4,-2)


Aconic=Conic[A0,A1,A2,A3,A4]

SetColor[ Aconic, "Red"]


L=Line[(0, 0.002),(-0.002, 0)]

SetColor[L, "Blue"]

A=Intersect[L, Aconic]


SetActiveView[1]

CenterView[(0,0)]

ZoomOut[0.01/x(Corner[1,3]-Corner[1,1])]

https://ggbm.at/564913

Comments (2)

photo
1

Second remark is that certain conics disappear with Zoomfactor < 0.01.

I'm giving an example (See attached file and press Zoom-button):


Short description of relevant construction steps.

Create a conic through 5 points (Aconic).

Define a Zoomfactor.

Dilate the conic with that zoomfactor (Bconic).

Also Dilate the points with zoomfactor.

Create a conic through the dilated points (Cconic).


The Cconic disappears when Zoomfactor < 0.01.


A0 = (0, 0)

A1 = (2, 4)

A2 = (6, 4)

A3 = (8, 0)

A4 = (4,-2)

Aconic=Conic[A0, A1, A2, A3, A4]

SetColor[ Aconic, "Red"]


ZoomOut=0.008


Bconic=Dilate[Aconic, ZoomOut, A0]

SetColor[ Bconic, "Orange "]


C1 = Dilate[A1, ZoomOut, A0]

C2 = Dilate[A2, ZoomOut, A0]

C3 = Dilate[A3, ZoomOut, A0]

C4 = Dilate[A4, ZoomOut, A0]


Cconic=Conic[A0, C1, C2, C3, C4]

SetColor[ Bconic, "Blue"]


SetActiveView[1]

CenterView[(0,0)]

ZoomOut[ZoomOut / y(Corner[1,3]-Corner[1,1])]

https://ggbm.at/564915

photo
1

Third remark is that implicit curve disappears.

I'm giving an example (See attached file and press Zoom-buttons):


Short description of relevant construction steps.

Create a conic through 5 points (Pconic).

Define a function like that conic.

Make a Implicit curve for that function (Fconic).

Zoomin and see the disappearance of that implicit curve.


P1 = (0, 0)

P2 = (4,-2)

P3 = (8, 0)

P4 = (6, 4)

P5 = (2, 4)

Pconic=Conic[P1, P2, P3, P4, P5]

SetColor[ Pconic, "Blue"]


f(x,y)=-6x² - 11y² + 48x + 26y

Fconic=ImplicitCurve[f(x, y)]

SetColor[ Fconic, "Red"]


SetActiveView[1]

CenterView[(0.02,0)]

ZoomOut[0.01*10 / y(Corner[1,3]-Corner[1,1])]

https://ggbm.at/564917

© 2023 International GeoGebra Institute