key: cord-0059135-x62pxlcl authors: Anto, Luis A.; Fiestas, Amelia M.; Ojeda, Edgar J.; Velezmoro, Ricardo; Ipanaqué, Robert title: A Mathematica Package for Plotting Implicitly Defined Hypersurfaces in [Image: see text] date: 2020-08-19 journal: Computational Science and Its Applications - ICCSA 2020 DOI: 10.1007/978-3-030-58802-1_9 sha: 68a573a0762967f45a14ce5e47247744693a5e4d doc_id: 59135 cord_uid: x62pxlcl Plotting implicitly defined geometric objects is a very important topic on computer graphics, computer aided design and geometry processing. In fact, the most important computer algebra systems include sophisticated tools for plotting implicitly defined curves and surfaces. This paper describes a new Mathematica package, 4DPlots, for plotting implicitly defined hypersurfaces (solids) in [Image: see text] using a generalization of the bisection method that is applied to continuous functions of four variables by recursive bisection of segments contained in their domain. The output obtained is consistent with Mathematica’s notation and results. The performance of the package is discussed by means of several illustrative and interesting examples. Plotting implicitly defined geometric mathematical objects is a very important topic on computer graphics, computer aided design and geometry processing [2, [4] [5] [6] [7] 15, 24, 26, 27] . There are several powerful algorithms to obtain points that satisfy the equations that express the curves and surfaces given implicitly [8, 9, 14, 24, 25, 28] . In fact, the most important computer algebra systems include sophisticated tools for plotting implicitly defined curves and surfaces [13, 17, 23, 30, 31] . Currently, there are even online applications to plot these objects [11, 16] . The approximation of zeros of continuous functions of various variables and real value has application to reality, specifically in nonlinear minimization problems [21] . Several works have been carried out to solve the problem of the approximation of zeros of continuous functions of various variables and real value, based on the bisection method [18, 20] . In [3, 22] it has been used to approximate zeros of functions of various variables and real value, thus obtaining the graph of curves and surfaces defined implicitly. Even, there is a previous result to this paper in which the wireframe plots of implicitly defined hypersurfaces is obtained [1] . This paper presents a new Mathematica package, 4DPlots, which incorporates a command for visualizing hypersurfaces (solids) inmersed in IR 4 . The encoding of the command is based on the multivariable bisection method. The command provide the user with a highly intuitive, mathematical-looking output consistent with Mathematica's notation and syntax [19] . The structure of this paper is as follows: Sect. 2 introduce the mathematical definition of the multivariate bisection method and its algorithm. For the sake of illustration, some surface plots are also briefly described in this section. Then, Sect. 3 introduces the new Mathematica package, 4DPlots, and describes the command implemented within. The performance of the package is also discussed in this section by using some illustrative examples to plot implicit hypersurfaces. Finally, Sect. 5 closes with the main conclusions of this paper. converges to p when n → ∞, with f (p) = 0, as fast as 1 2 n n∈IN converges to zero. The previous definition can be coded without any problem but it is not practical when operating with tolerance, for this reason it will be necessary to resort to an algorithm associated with this method. For example, consider finding the zero of f (x) = e −x (3.2 sin(x) − 0.5 cos(x)) on the interval [3, 4] . An approximation of function's zero using the command implemented in the previous definition (n = 20) is: It is briefly verified that: The algorithm of the bisection method used in this paper is based on the algorithm proposed by Burden et al. [10] . The modification is that the maximum number of iterations is not considered. OUTPUT approximate solution p. Step Step 6 OUTPUT (p). If in the previous example it is required that T OL = 0.001, then we obtain the next value of p: Bisection[f[x],x,3,4,0.001] It is easily verified that the required precision is met, that is, |f (p)| < 0.001: 0.0000342246 According to Gomes [14] the bisection method can be applied to functions of various variables and real value. Based on this, the definition and algorithm for the multivariate bisection method are stated as follows. converges top when n → ∞, with f (p) = 0, as fast as 1 2 n n∈IN converges to zero. Note that in the previous definition each approximation ofp is always on the segment ā,b . For the same reasons explained above, we will enunciate an algorithm associated with this method. Step 1 Set i = 1; F A = f (ā). Step 2 While 0.5 · ||b − a|| > = T OL do Steps 3-5. Step 3 Setp = 0.5 · (ā +b); F P = f (p). Step 4 If F P = 0 or |F P | < T OL then OUTPUT (p); STOP. Step 5 If F A · F P > 0 then setā =p; F A = F P else setb =p. Step 6 OUTPUT (p). It is easily verified that the required precision is met, that is, |f (p)| < 0.001: 0.000886917 Figure 1 shows the geometric interpretation of the bisection method in the univariate (left) and bivariate (right) cases. As can be seen, the zeros of the bivariate function form a curve on the xy plane and the approximation ofp is made on the closed segment ā,b . If a mesh is constructed over the domain of f (Fig. 2, left) , each subinterval that makes up the mesh (both horizontal and vertical) constitutes a closed segment and it is possible to apply the multivariate bisection method on such segments (Fig. 2, right) . For example, the roots of a function f : IR 2 → IR make up a curve (Fig. 3, left) , of a function f : IR 3 → IR make up a surface (Fig. 3, right) , of a function f : IR 4 → IR make up a solid, and so on. Extending the ideas presented with the geometric interpretation of the bivariate bisection method, it is possible to have a clear idea of the geometric interpretation of the multivariate bisection method (Fig. 3) . To trace the hypersurfaces, defined implicitly, from the following section a trimetric-trimetric model according to [29] is used. This is, −1, −1) , (1, 0, 0), (0, 1, 0), (0, 0, 1) and This section describes some examples of the application of this package. Firstly, we load the package: The command incorporated in this package is: With the ImplicitPlot4D command it is possible to visualize the projections of the graphs of the hyperplanes H 1 : x = 0 and H 2 : y = 0; and with the built-in Show command, combine both graphics. The following sentences show the projection of the unit hypersphere H 3 : x 2 + y 2 + z 2 + w 2 = 1 and its normal hyperplane H 4 : w = 1, at the point (0, 0, 0, 1). The following sentences allow to obtain the projections of three hyperquadric and one equilateral hyperhyperbola. The bisection method could extend naturally, from Definition 4, as indicated in the following definition [12] . This definition can be used to approximate zeros of functions such as F = (x 2 + y 2 + z 2 − 1, x + y + z) (Fig. 7, left) . Even more bold and based on the isomorphism between C and IR 2 , we could approximate the zeros of the function F = z 2 + w 2 − 1, where z = x + iy and w = u + iv. In fact, some points were obtained which are shown in Fig. 7 (center). Then in Fig. 7 (right) , the points are shown along with the graph of the functions w = √ 1 − z 2 and w = − √ 1 − z 2 [12, 29] . We emphasize here that by improving the technique or using a more effective method, a new ImplicitComplexPlot command can be implemented. In this paper, a new Mathematica package for plotting implicitly defined hypersurfaces (solids) inmersed in IR 4 is introduced. The incorporated command in this package will help explore several aspects of various solids immersed in IR 4 . The algorithm for these commands is based on multivariate bisection method. The performance of the package is discussed by means of some illustrative and interesting examples. Additionally, a compact definition is presented, as well as its respective Mathematica coding, of the bisection method. All the commands have been implemented in Mathematica version 11.0 and are consistent with Mathematica's notation and results. The powerful Mathematica functional programming [19] features have been extensively used to make the program shorter and more efficient. From our experience, Mathematica provides an excellent framework for this kind of developments. Aproximación de los ceros de funciones continuas de varias variables reales y valor real mediante el método de bisección con el Mathematica Computer Graphics and Geometric Modeling, Implementation and Algorithms Bisection method in higher dimensions and the efficiency number Geometry processing: curvature analysis and surface-surface intersection Geometry Processing for Design and Manufacturing Guide to Computational Geometry Processing Computer Aided Design and Manufacturing Introduction to Implicit Surfaces Numerical Analysis, 10th edn. Cengage Learning Aproximación de ceros de funciones continuas de dos variables complejas y valor complejo mediante el método de bisección The Maple Book Implicit Curves and Surfaces: Mathematics, Data Structures and Algorithms Geometry and Algorithms for Computer Aided Design Breve manual de Maxima The multivariate bisection algorithm. ARXIV Programming in Mathematica An improved bisection method in two dimensions A multidimensional bisection method Multi-Dimensional Bisection Method Homepage Fundamentals of Graphics Using MatLab Shape Interrogation for Computer Aided Design and Manufacturing Certified Algorithms for Implicit Surfaces Fundamentals of Computer Graphics Implizite Flächen. Mathematical Methods in Computer Aided Geometric Design A mathematica package for visualizing objects inmersed in R 4 The Mathematica Book, 5th edn Acknowledgements. The authors would like to thank to the authorities of the Universidad Nacional de Piura for the acquisition of the Mathematica 11.0 license and the reviewers for their valuable comments and suggestions.