# Gröbner implicitization and the 'giacR' package

I considerably improved the computation of the Gröbner bases in the **qspray** package, and I implemented something new: *Gröbner implicitization*. The Gröbner implicitization is able to transform a system of parametric equations to an implicit equation. Let’s see the example of the ellipse:

```
library(qspray)
# variables
qlone(1)
cost <- qlone(2)
sint <-# parameters
qlone(3)
a <- qlone(4)
b <-#
2
nvariables <- c("a", "b")
parameters <- list(
equations <-"x" = a * cost,
"y" = b * sint
) list(
relations <-^2 + sint^2 - 1 # = 0
cost
)#
eqs <- implicitization(nvariables, parameters, equations, relations)
## a^2*b^2 - b^2*x^2 - a^2*y^2
```

You see, `a^2*b^2 - b^2*x^2 - a^2*y^2 = 0`

is the implicit equation of the ellipse.

Gröbner implicitization is based on Gröbner bases. Unfortunately, while I considerably improved it, my implementation of the Gröbner bases can be slow, very slow. For the ellipse above, it is fast. But I tried for example to implicitize the parametric equations of the Enneper surface, and the computation was not terminated after 24 hours.

No worries. I have a new package coming to the rescue: **giacR**. This is an interface to the *Giac* computer algebra system, which powers the graphical interface *Xcas*. It is extremely efficient, and it is able to compute Gröbner bases.

Gröbner implicitization is not implemented in Giac. So I implemented it myself. Here is the implicit equation of the Enneper surface:

```
library(giacR)
Giac$new()
giac <-
equations <- "x = 3*u + 3*u*v^2 - u^3, y = 3*v + 3*u^2*v - v^3, z = 3*u^2 - 3*v^2"
"u, v"
variables <-
$implicitization(equations = equations, variables = variables)
giac## [1] "-19683*x^6+59049*x^4*y^2-10935*x^4*z^3-118098*x^4*z^2+59049*x^4*z-59049*x^2*y^4-56862*x^2*y^2*z^3-118098*x^2*y^2*z-1296*x^2*z^6-34992*x^2*z^5-174960*x^2*z^4+314928*x^2*z^3+19683*y^6-10935*y^4*z^3+118098*y^4*z^2+59049*y^4*z+1296*y^2*z^6-34992*y^2*z^5+174960*y^2*z^4+314928*y^2*z^3+64*z^9-10368*z^7+419904*z^5"
```

Finally we close the Giac session:

```
$close()
giac## [1] TRUE
```