Matlab code of mobius transform

I need to write a code to convert a series of lines into a series of circles, and here are the pictures I have. I know I should use Möbius transformation, and I have searched a lot but I don't understand what I should do. Could anyone help?

 Accepted Answer

[edit: added SAAAA to the reply]
consider the points on a circle to be points on the complex plane, z=x+iy. A straight line is a circle with an infinite radius. The Möbius transformation maps circles (including straight lines) into circles. As you know, the Möbius transformation is
where z1 represents the points on the first circle and z2 are the points on the transformed circle. Experiment with different values for a,b,c,d and you will learn what values can do what.
Example:
Define and plot three straight lines
z1a=-ones(1,101)+i*[-10:.2:10]; % vertical line
z1b=-2*ones(1,101)+i*[-10:.2:10]; % vertical line
z1c=[-10:.2:10]+i*ones(1,101); % horizontal line
plot(z1a,'-r.'); hold on; plot(z1b,'-g.'); plot(z1c,'-b.'); axis equal
Transform the points with a Möbius transformation with b=c=1 and a=d=0:
z2a=1./z1a; z2b=1./z1b; z2c=1./z1c;
Plot transformed points:
figure;
plot(z2a,'-r.'); hold on; plot(z2b,'-g.'); plot(z2c,'-b.');
axis equal
OK

4 Comments

If the straight lines had been infinite, then the circles on the z2 planes would go all the way around, and they would all interesct at the origin of the z2 plane.
You may wonder why I picked a=d=0 for my example Möbius transform. Here is a hand-waving rationale (not a rigorous proof, which is beyond my ability) for the choice of a=d=0.
I wanted to transform some prallel and perpendicular lines to a set of circles that intersect at a common point, since that is what your left and right plots show. The straight lines on your left plot do not all interesect at a common point, but the transformed lines (circles) on the right DO all share a common intersection. How can this happen? It can happen if all the straight lines go to infinity, because in that case, the different straight lines have a common point: the point at infinity. (I know it is a different infinite point for different lines, but let's ignore that detail.) The point(s) get transformed to a common point, , by the Möbius transformation (i.e. a=d=0). b and c could be any real numbers, here. I choose b=c=1 for simplicity.
Another cool thing about the Möbius transformation is that it is a conformal mapping, which means it preserves angles, where two curves intersect. In this case, the straight lines that are perpendicular get transformed to circles which intersect at perpendicular angles, and the straight lines that are parallel (and which meet at infinity) get transformed to circles which are parallel where they meet at the origin.
You have edited your original post, removing the images you originally posted. Please restore those images so that the question makes more sense and so it will be useful to others. Thank you.
Thanks alot for your helpful reply
@SAAAA, you arew welcome. Good luck with your studies.

Sign in to comment.

More Answers (1)

I understand that you need to write a code to convert a series of lines into a series of circles. Here is the code you can start with:
% Define the grid of points
[x, y] = meshgrid(linspace(-2, 2, 1000), linspace(-2, 2, 1000));
z = x + 1i * y; % Convert the grid to complex numbers
% Define the Möbius transformation with a fixed point at the origin
a = 0;
b = 1;
c = 1;
d = 0;
f = @(z) (a * z + b) ./ (c * z + d);
% Define the range for the lines
line_range = linspace(-2, 2, 20);
% Plot the original grid
figure;
subplot(1, 2, 1);
hold on;
for k = line_range
plot(x(1, :), k * ones(size(x(1, :))), 'b'); % Horizontal lines
plot(k * ones(size(y(:, 1))), y(:, 1), 'r'); % Vertical lines
end
axis equal;
xlim([-2, 2]);
ylim([-2, 2]);
title('Original Grid');
% Plot the transformed grid
subplot(1, 2, 2);
hold on;
for k = line_range
% Apply the Möbius transformation to each horizontal line
horizontal_line = f(x(1, :) + 1i * k);
plot(real(horizontal_line), imag(horizontal_line), 'b'); % Transformed horizontal lines
% Apply the Möbius transformation to each vertical line
vertical_line = f(k + 1i * y(:, 1));
plot(real(vertical_line), imag(vertical_line), 'r'); % Transformed vertical lines
end
axis equal;
xlim([-1.5, 1.5]); % Adjust axis limits if necessary
ylim([-1.5, 1.5]); % Adjust axis limits if necessary
title('Transformed Grid');
% Make sure the plots hold their properties
hold off;
Thanks,
Ayush

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!