Full Text
1. Introduction In this paper we study the creation of animation animation using the vector graphics language Asymptote [
1-4]. Asymptote is an interpreted language, that is a translator into the PostScript vector graphics language. Designed to create vector images for mathematical publications. It is closely integrated with the TEX system and is an integral part of the TEX Live [
5] distribution. It has a C-like syntax, supports the creation of functions, custom data structures, and comes with an extensive set of modules for various tasks. Unlike PGF/TikZ [
6], Asymptote is more imperative, so it is easier to implement complex program logic on it. In the official documentation of this language, only a few paragraphs are devoted to the animation creation process and the user is referred to the source code examples located in the animations directory. Asymptote creates animation in two steps. At the first step, a multi-page PDF-file is created containing images that will become frames of future animation. Then, using the external utility ImageMagick [
7] (command convert), this PDF-file is converted into a GIF image. If the ImageMagick utility is not installed on the user’s system, all examples will stop at creating a multi-page PDF-file with a set of images and a GIF image with animation will not be received. In this article, we are considering a universal way to create animation in video format using the ffmpeg [
8,
9] and Ghostscript [
10] utilities. All external programs will be called explicitly from the command line. With the help of Asymptote, only a multi-page PDF-file with frames for the future video will be created. The reader should be familiar with the basic capabilities of the Asymptote language. For an introduction to the basics of the language, we recommend the manual [
11]. The information from it will be enough to understand this work. As an example, we chose the animation of the process of constructing epitrochoids and hypotrochoids. In the first part of the work, we will recall the definitions of these curves, some of their properties and reduce their construction to a composition of two rotations. In the second part of the article, we will describe in detail the implementation of their construction using Asymptote. And in the third part we will focus on the technical side of the issue and describe the process of creating a multi-page PDF-file, converting it into PNG images using Ghostscript and converting these images into video using ffmpeg. 2. Task description Consider the task of animating the process of constructing cycloidal curves, namely hypotrochoids and epitrochoids. We will not use the parametric equation of these curves, but will reduce everything to the composition of two rotations applied to the starting point of the curve. This will better illustrate the capabilities of the Asymptote language. 2.1. Definition of epitrochoids Epitrochoid is defined as a trajectory plotted by a fixed point
About the authors
RUDN University
Email: gevorkyan-mn@rudn.ru
ORCID iD: 0000-0002-4834-4895
Candidate of Sciences in Physics and Mathematics, Associate Professor of Department of Applied Probability and Informatics
6, Miklukho-Maklaya St., Moscow, 117198, Russian Federation
RUDN University
Email: korolkova-av@rudn.ru
ORCID iD: 0000-0001-7141-7610
Candidate of Sciences in Physics and Mathematics, Associate Professor of Department of Applied Probability and Informatics
6, Miklukho-Maklaya St., Moscow, 117198, Russian Federation
RUDN University; Joint Institute for Nuclear Research
Author for correspondence.
Email: kulyabov-ds@rudn.ru
ORCID iD: 0000-0002-0877-7063
Doctor of Sciences in Physics and Mathematics, Professor of the Department of Applied Probability and Informatics of Peoples’ Friendship University of Russia named after Patrice Lumumba (RUDN University); Senior Researcher of Laboratory of Information Technologies, Joint Institute for Nuclear Research
6, Miklukho-Maklaya St., Moscow, 117198, Russian Federation; 6, Joliot-Curie St., Dubna, Moscow Region, 141980, Russian Federation