Motivated by the problem of certified drawing of plane curves, this software is a Python implementation of the algorithms presented in [1]. It basically concerns isolating the singularities of the plane projection of a generic curve embedded in ${\mathbb{R}}^{n}$. This type of curves appears naturally in robotics applications and visualization. We present in [1, Section 6] some experiments, some of which are not reachable by other methods. The software can be dowloaded from its GitHub page.

In the following, by an interval we mean a list $[a,b]$ of floats $a,b$ that represent the lower and upper bounds respectively. By a box we mean a list of intervals.

This function returns a list of two lists: The first one is a list of boxes in ${\mathbb{R}}^{n}$ that cover a smooth part of the curve (more precisely, where the used solver IbexSolve succeeds to certify the smoothness). The second one contains boxes where the used solver (IbexSolve) fails to certify the smoothness of the curve.

A string that is the name of the txt file which contains the equations that define the curve.

A box that contains the curve

A list of the sympy symbols that appear in the equations of system.

Minimal width of output boxes. This is a criterion to stop bisection: a non-validated box will not be larger than ‘eps-min’. Default value is 1e-3.

Maximal width of output boxes. This is a criterion to force bisection: a validated box will not be larger than ‘eps-max’ (unless there is no equality and it is fully inside inequalities). Default value is 1e-1.

In [1]:

```
import Isolating_singularities as isos
import sympy as sp
##################################
#Creating the system file #######
##################################
#The user can creat the txt file manualy where every
#line represents an equation that defines the curve.
#However, the following code is to creat the system
#file using Python.
fil=open("system.txt","w")
fil.write("(x1 - 8*cos(x3))^2 + (x2 - 8*sin(x3) )^2 - 23 \n")
fil.write("(x1 - 9 - 5* cos(x4) )^2 + (x2 - 5* sin(x4))^2 - 60 \n")
fil.write( "(2*x1 - 16*cos(x3))*(2*x2 - 10*sin(x4)) - (2*x2 - 16*sin(x3))*(2*x1 - 10*cos(x4) - 18)")
fil.close()
##################################
#Declaring parameters #######
##################################
System="system.txt"
Box=[[-5,15],[-15,15],[-3.14,3.14],[-3.14,3.14]]
X=[sp.Symbol("x"+str(i)) for i in range(1,5)]
##################################
#Applying the function #######
##################################
boxes =isos.enclosing_curve(System,Box,X)
print(len(boxes[0])) #the number of certified boxes
print(len(boxes[1])) #the number of unknown boxes
```

This function plots a plane projection of $enclosin{g}_{c}urve$ output.

A list of boxes that cover a smooth part of the curve certified by IbexSolve. The function plots the plane projection of this list in green.

A list of boxes that cover the part of the curve where IbexSolve fails to certify the smoothness. The function plots the plane projection of this list in red.

A list of two integers that determines the variables for which the plane projection is considered.By default, the function considers the first two variables.

Determines the domain of the graph. By defult, it is set to be $[-20,20{]}^{2}$.

A set of boxes each of which contains a node (to be computed later)

A set of boxes each of which contains a cusp (to be computed later)

The plane projection with respect to ${x}_{1}$ and ${x}_{2}$.

In [2]:

```
isos.ploting_boxes(boxes[0],boxes[1])
# boxes if the output of enclosing_curve
```

The plane projection with respect to ${x}_{3}$ and ${x}_{4}$.

In [3]:

```
isos.ploting_boxes(boxes[0],boxes[1],\
var=[2,3],B=[[-3.14,3.14],[-3.14,3.14]])
```

This function returns a set of two sets. The first one contains 2d boxes each of which contains exactly one node of the plane projection (with respect to the first two variables). The second one is a list of boxes such that every box contains either one ordinary cusp or a node that is a projection of two branches closed to each other.

**System, Box, X**, **eps_min** and **eps_max** are as in $enclosing\mathrm{\_}curve$.

**boxes** is the output of $enclosing\mathrm{\_}curve$.

**threshold**
A parameter that determines when to use Taylor form instead of the standard way of comuting the Ball system. This improves the performance when there are nodes that are induced by the projection of too-close branches. The default value us 1e-2.

In the following, $nodes$ contains boxes each of which has a solution of Ball with $t\ne 0$. $nodes\mathrm{\_}or\mathrm{\_}cusps$ contains boxes each of which has a solution of Ball with $t=0$.

In [4]:

```
nodes, nodes_or_cusps=isos.enclosing_singularities(System,boxes,Box,X)
#plotting the singularities
isos.ploting_boxes(boxes[0],boxes[1],B=[[-5,15],[-15,15]]\
,nodes=nodes, cusps=nodes_or_cusps)
```

This function plots the 3D-projection of the given curve with respect to the three variables with the variables indexed by the elements of var. However, the drawing is not certified.

The 3D-projection with respect to the first three variables.

In [3]:

```
isos.plotting_3D(boxes[0], var=[1,2,3],B=[[-3.14,3.14]*3])
```

Here are few additional examples from different types of curves.

2D-projection of a high-degree curve in ${\mathbb{R}}^{n}$

Haas Curve of Degree 11

Nice curve! isn't it?

A curve defined by complicated polynomials

A complicated algebraic curve