// File: iannisdezwart[P]forcefield-visualiser/./motion.hpp
// Function: motion::circular()
void circular()
	{
		// The fixed mass in the middle

		masses.push_back(Mass(WIDTH / 2, HEIGHT / 2, 1));

		// The moving mass

		Mass moving_mass(300, 0, 1);
		masses.push_back(moving_mass);

		// Set the rotation

		double rotation = 0.01 * 2 * M_PI;

		Matrix<2, 2> rotation_matrix({
			{ cos(rotation), -sin(rotation) },
			{ sin(rotation), cos(rotation) },
		});

		// Render 100 frames

		for (int i = 0; i < 100; i++) {
			string frame_number = to_string(i);

			if (frame_number.length() != 4) {
				frame_number = string(4 - frame_number.length(), '0') + frame_number;
			}

			// Move the moving mass

			moving_mass.position = rotation_matrix * moving_mass.position;

			// Set the moving mass in the image

			masses[1].position = masses[0].position + moving_mass.position;

			render_image("output/" + frame_number + ".png", MULTI_THREADED);

			cout << "Rendered frame " << i << "/" << "100\n";
		}
	}

// Assembly:
subq $0x208, %rsp            # imm = 0x208
leaq 0x1f0(%rsp), %rdi
movl $0x3c0, %esi            # imm = 0x3C0
movl $0x21c, %edx            # imm = 0x21C
movl $0x1, %ecx
callq 0x5d10
leaq 0x111e6(%rip), %rdi     # 0x15360
leaq 0x1f0(%rsp), %rsi
callq 0x6410
leaq 0x1d0(%rsp), %rdi
movl $0x12c, %esi            # imm = 0x12C
xorl %edx, %edx
movl $0x1, %ecx
callq 0x5d10
leaq 0x111b9(%rip), %rdi     # 0x15360
leaq 0x1d0(%rsp), %rsi
callq 0x5db0
movsd 0xae8c(%rip), %xmm0     # 0xf048
movsd %xmm0, 0x1c8(%rsp)
movsd 0x1c8(%rsp), %xmm0
callq 0x35f0
movsd %xmm0, 0x168(%rsp)
movsd 0x1c8(%rsp), %xmm0
callq 0x3090
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x170(%rsp)
leaq 0x168(%rsp), %rax
movq %rax, 0x178(%rsp)
movq $0x2, 0x180(%rsp)
movsd 0x1c8(%rsp), %xmm0
callq 0x3090
movsd %xmm0, 0x158(%rsp)
movsd 0x1c8(%rsp), %xmm0
callq 0x35f0
movsd %xmm0, 0x160(%rsp)
leaq 0x158(%rsp), %rax
movq %rax, 0x188(%rsp)
movq $0x2, 0x190(%rsp)
leaq 0x178(%rsp), %rax
movq %rax, 0x198(%rsp)
movq $0x2, 0x1a0(%rsp)
movq 0x198(%rsp), %rsi
movq 0x1a0(%rsp), %rdx
leaq 0x1a8(%rsp), %rdi
callq 0x6440
movl $0x0, 0x154(%rsp)
cmpl $0x64, 0x154(%rsp)
jge 0x4608
movl 0x154(%rsp), %esi
leaq 0x130(%rsp), %rdi
callq 0x65f0
leaq 0x130(%rsp), %rdi
callq 0x3480
cmpq $0x4, %rax
je 0x43e0
leaq 0x130(%rsp), %rdi
callq 0x3480
movq %rax, %rcx
movl $0x4, %eax
subq %rcx, %rax
movq %rax, 0x40(%rsp)
leaq 0xef(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x35b0
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rcx
leaq 0xf0(%rsp), %rdi
movl $0x30, %edx
callq 0x6780
jmp 0x433a
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0x130(%rsp), %rdx
callq 0x6730
jmp 0x4359
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x33d0
leaq 0x110(%rsp), %rdi
callq 0x3200
leaq 0xf0(%rsp), %rdi
callq 0x3200
leaq 0xef(%rsp), %rdi
callq 0x3360
jmp 0x43e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x43ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x3200
leaq 0xef(%rsp), %rdi
callq 0x3360
jmp 0x45f9
movups 0x1d0(%rsp), %xmm0
movaps %xmm0, 0xb0(%rsp)
movsd 0xb0(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
leaq 0x1a8(%rsp), %rdi
callq 0x6800
movsd %xmm1, 0x30(%rsp)
movsd %xmm0, 0x38(%rsp)
jmp 0x441d
movsd 0x30(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movsd %xmm1, 0xc8(%rsp)
movsd %xmm0, 0xd0(%rsp)
movups 0xc8(%rsp), %xmm0
movaps %xmm0, 0x1d0(%rsp)
leaq 0x10f0e(%rip), %rdi     # 0x15360
xorl %eax, %eax
movl %eax, %esi
callq 0x5f30
movq %rax, %rdi
movaps 0x1d0(%rsp), %xmm0
movaps %xmm0, 0x90(%rsp)
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
callq 0x68f0
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
jmp 0x4493
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd %xmm1, 0xa0(%rsp)
movsd %xmm0, 0xa8(%rsp)
leaq 0x10ea8(%rip), %rdi     # 0x15360
movl $0x1, %esi
callq 0x5f30
movups 0xa0(%rsp), %xmm0
movups %xmm0, (%rax)
leaq 0xabd4(%rip), %rsi      # 0xf0a8
leaq 0x50(%rsp), %rdi
leaq 0x130(%rsp), %rdx
callq 0x69d0
jmp 0x44e8
leaq 0xabe9(%rip), %rdx      # 0xf0d8
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x6980
jmp 0x4500
leaq 0x70(%rsp), %rdi
movl $0x1, %esi
callq 0x3f40
jmp 0x4511
leaq 0x70(%rsp), %rdi
callq 0x3200
leaq 0x50(%rsp), %rdi
callq 0x3200
movq 0x10aa4(%rip), %rdi     # 0x14fd0
leaq 0xab7d(%rip), %rsi      # 0xf0b0
callq 0x3310
movq %rax, 0x18(%rsp)
jmp 0x453f
movq 0x18(%rsp), %rdi
movl 0x154(%rsp), %esi
callq 0x3560
movq %rax, 0x10(%rsp)
jmp 0x4557
movq 0x10(%rsp), %rdi
leaq 0xab4b(%rip), %rsi      # 0xf0ae
callq 0x3310
movq %rax, 0x8(%rsp)
jmp 0x456f
movq 0x8(%rsp), %rdi
leaq 0xab45(%rip), %rsi      # 0xf0c0
callq 0x3310
jmp 0x4582
leaq 0x130(%rsp), %rdi
callq 0x3200
movl 0x154(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x154(%rsp)
jmp 0x42b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x45f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x45ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x3200
leaq 0x50(%rsp), %rdi
callq 0x3200
leaq 0x130(%rsp), %rdi
callq 0x3200
jmp 0x4610
addq $0x208, %rsp            # imm = 0x208
retq
movq 0xe0(%rsp), %rdi
callq 0x3590
nopl (%rax)