Matlab code of mobius transform

조회 수: 9 (최근 30일)
SAAAA
SAAAA 2024년 1월 2일
댓글: William Rose 2024년 1월 8일
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?
  댓글 수: 1
Rena Berman
Rena Berman 2024년 1월 4일
(Answers Dev) restored edit

댓글을 달려면 로그인하십시오.

채택된 답변

William Rose
William Rose 2024년 1월 2일
편집: William Rose 2024년 1월 2일
[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
SAAAA
SAAAA 2024년 1월 6일
Thanks alot for your helpful reply
William Rose
William Rose 2024년 1월 8일
@SAAAA, you arew welcome. Good luck with your studies.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ayush
Ayush 2024년 1월 3일
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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by