(Circle + Square)/Triangle: Using Shape-Based Expressions for Image Creation and Exploration

Year: 2023 Authors: John Nicholson

Core claim

Shapes and curves can be treated as operands in mathematical expressions, and software can evaluate these expressions to create novel static and animated visual compositions.

Topics

shape-based expressions, image creation, animation, curve operations, motion and translation

Domains

parametric equations, geometric transformations, complex plane-inspired operators, curve composition, density plots, generative art, computer graphics, visual exploration

Methods

evaluating expressions with shape operands, addition, subtraction, multiplication, and division of shapes, rotation and translation of operands, offset-based motion over discrete steps, path-based rendering

Media

software, static images, animations, density plots, supplementary materials

Paper text

The text below is the locally extracted OCR/Markdown version of the paper. Raw PDF files remain local and are not published here.

Bridges 2023 Conference Proceedings

(Circle + Square)/Triangle: Using Shape-Based Expressions for Image Creation and Exploration

John Nicholson

Austin Peay State University, Clarksville, TN, USA; nicholsonja@apsu.edu

Abstract

This paper describes a method for evaluating simple math expressions in which the operands are shapes, lines, and curves. The operands can be either stationary or placed in motion through rotation and translation operations. The results of these expressions can be evaluated with the aid of software, allowing them to be rendered as both static images and animations.

Shape-Based Expressions

In basic expressions such as

values can be assigned to and so that a value for can be calculated. The work described here is based on a simple question: what would the value of be if and were shapes? For example, if was a square and was a circle, then in the expression

what would be the value of ? With this question as a starting point, I developed a method to evaluate simple expressions with shapes as the operands and then implemented software that can render images created from the results of the shape-based expressions.

The first step is to define shape as any 2-dimensional shape, curve, or line that has the center and that can be expressed with parametric equations and , which are used to calculate ‘s coordinates based on :

Next is to define a general version of equation (1):

where and are shapes, is an operator such as or , and is the shape resulting from the expression. Applying the equations in (3) to equation (4) leads to

Although not expressed in the equations, the software also contains a rotation function that rotates a shape around its center. Examples of the addition, subtraction, multiplication, and division operations on a circle

489

Nicholson

img-0.jpeg (a) (red outer shape) and (blue inner shape).

img-1.jpeg (b) (red curve).

img-2.jpeg (c) (set of red lines).

Figure 1: Results of basic operations on square and circle where ‘s radius is 3, is inscribed in , and both are centered at the origin.

and a square are shown in Figure 1. As the figures show, the results can be closed curves (Figure 1(a)) or open curves (Figure 1(b)). Division (Figure 1(c)) may result in a division by 0 when parts of the shape operand in the denominator intersect the x-axis or y-axis. In these cases, values in move towards infinity and result in lines going beyond the “interesting” part of the image, as represented by the horizontal and vertical lines in the figure.

Using these basic concepts, any number of shapes and types of shapes can be combined using any set of operators. For example, Figure 2 shows the result of the expression

where all shapes are inscribed in the circle, similar to the square and circle in Figure 1. Figure 3 shows the result of multiplying two more complex curves.

img-3.jpeg Figure 2: Spaceship-like result of adding and subtracting multiple shapes.

img-4.jpeg (a) Epicycloid (blue) and rose curve (red) centered at the origin.

img-5.jpeg (b) epicycloid * rose curve.

Figure 3: Multiplying more complex curves.

Since this project is software-based, drawing a shape requires starting at some point on the curve, usually at . The initial point can be changed by adding a starting offset to , which affects how the shape interacts with the other shapes in the expression. Adding offsets for and to the equations in (5) leads to

(Circle + Square)/Triangle: Using Shape-Based Expressions for Image Creation

and Exploration

img-6.jpeg (a) with no offset or rotation.

img-7.jpeg (b) with no offset and rotated .

img-8.jpeg (c) with and no rotation.

img-9.jpeg (d) with and rotated .

img-10.jpeg (e) Result for Figure (a).

img-11.jpeg (f) Result for Figure (b).

img-12.jpeg (g) Result for Figure (c).

img-13.jpeg (h) Result for Figure (d). Figure 4: where is a lemniscate and is a triangle. The results in the second row vary depending on ‘s starting offset location (red dots) and rotation in the first row.

Motion

Once starting offsets and rotations were implemented, as demonstrated in Figure 4, it became apparent that motion could be used to create more complex images, both static and animated. A shape’s starting offset could move along the entire path of a shape, and shapes could make complete rotations from to . Combining the results at multiple offset positions and rotation angles created interesting results. Unlike the results in Figure 4 that were computed using single rotation angles and offset positions, Figure 5 shows how moving the offset, rotating a shape, and combining both movements result in different images when results from multiple discrete steps are combined into a final image.

img-14.jpeg (a) rotates around the origin. See Figure 4(b).

img-15.jpeg (b) ‘s offset moves around its perimeter. See Figure 4(c).

img-16.jpeg (c) rotates around the origin while its offset also moves. See Figure 4(d). Figure 5: Results for shapes in Figure 4 using 40 discrete steps for offset motion and rotation.

Although all shapes in the examples up to this point have been centered at , this is not a requirement and shapes can be centered at any coordinate. If a shape can be located anywhere, it is a simple extension to move a shape along a path , which is another shape itself. For example, a circle could move along the path defined by a square. Applying this to in the equation set (7) means that each operand can have its own unique path, and .

Nicholson

img-17.jpeg (a) A lemniscate moving along a path defined by a rose curve.

img-18.jpeg (b) Hypotrochoid.

img-19.jpeg (c) lemniscate hypotrochoid. Figure 6: Example of adding a moving shape, a lemniscate, to a static shape, a hypotrochoid.

Figure 6 shows an example of an image that can be created when one of the operands is moving along a path. The result in Figure 6(c) was rendered using a density-plot approach similar to the one described in [1].

Conclusion

Treating curves and shapes as operands in math expressions has allowed me to explore and create new mathematical-based images. Figure 7 shows some results, including one possible rendering of the paper’s title in Figure 7(b). Higher resolution versions of these images, as well as additional images, are available in the paper’s supplementary materials. The next step in this project is to develop a web-based interface for exploring these expressions, images, and animations.

img-20.jpeg (a) epitrochoid + hypotrochoid. Figure 7: Examples created from various shape expressions.

img-21.jpeg (b) (circle + square)/triangle.

img-22.jpeg (c) hypotrochoid * oval.

References

[1] J. Nicholson. “Curve Stitching Density Plots.” Bridges Conference Proceedings, Linz, Austria, July 16-20, 2019, pp.351-354. https://archive.bridgesmathart.org/2019/bridges2019-351..

0 items under this folder.