panescudumitru shared this question 4 years ago

Is there any command in 3D to generate the quadratic surface defined by 9 points in space? If not, are you aware of anybody who has written a sketch of this? I can solve the generic equation for a quadric in Mathematica, but that takes quite a bit of time (and accuracy when plugging in values). 1

I'm sure I've seen that using GeoGebra's matrix commands (but I can't find it :( )

Hopefully this helps:

https://math.stackexchange.... 1

How's this? Exact for 6 points: https://www.geogebra.org/m/fqfe5trp

(it can be made more efficient if the points only move vertically as M_A will then be constant)

I think you can probably use the SVD command if you want "best fit" through eg 9 points

https://wiki.geogebra.org/e... 1

Hi Michael,

f(x,y)=Sum(m3 {x², y², x y, x, y, 1})

can you check the result too?

got a list. why?

BTW

I remember there was a post to this? 1

I think that's OK. Try

`Sum(Sum(m3 {x², y², x y, x, y, 1}))`  1

I think this is OK for 9 points (maybe you can check against your Mathematica answers to verify)

https://www.geogebra.org/m/dwsk5nwg 1

Sorry, didn't use enough terms. I've updated https://www.geogebra.org/m/fqfe5trp so it's now exact for 9 points :) 1

I used the CAS to substitute into the general equation of a quadric the coordinates of the nine points, solve the resulting system of equations and again substitute the solution into the equation. I thus obtained the equation of the quadric, see here the result: https://www.geogebra.org/m/mxpdmt4n 1

with brute force. but I am afraid the PC crashes 1

Works well here (also in browser!)  1

... and much shorter solutions from Zbynek

```Fit({A, B, C, D, E, F, G, H, I}, {1, x, y, x y, x², y²})
```

`Fit({A, B, C, D, E, F, G, H, I}, {1, x, y, x y, x², y², x² y, x y², x² y²})` 1

... and what the original poster actually wants I think from Mathieu :)

https://www.geogebra.org/m/xqkwgcan 1

awesome

but they fail when (0,0,0) is in quadric (mine too)

this problem was also implementing conic