how to plot the state of polarisation distribution of a c or v point polarisation singularity using quiver plots

조회 수: 13 (최근 30일)
How to plot this state of polarisation distribution using quiver plots for a c point or v point polarisation singularity. Anyone please help.

채택된 답변

Milan Bansal
Milan Bansal 2024년 5월 28일
편집: Milan Bansal 2024년 5월 29일
Hi Aswathi K,
I understand that you want to plot the ellipses as shown in the image using the quiver plot for a c-point or v-point polarization singularity.
The quiver plot in MATLAB plots arrows with specified directional components at the specified Cartesian coordinates. It cannot plot the directional ellipses. However, for a workaround, you can refer to the following steps and the code snippet given below to plot the ellipses for a c-point polarization singularity:
  1. Define the grid: Create a grid of points where you want to plot the polarization ellipses.
  2. Calculate the ellipse parameters: For each point on the grid, calculate the parameters of the polarization ellipse (orientation, major and minor axes).
  3. Plot the ellipses: Use the plot function to draw ellipses at each grid point.
% Define the grid
[x, y] = meshgrid(-10:1:10, -10:1:10);
% Radius of the circular region
R = 10;
% Create a figure
figure;
hold on;
axis equal;
axis off;
% Define the number of points for plotting ellipses
num_points = 50;
t = linspace(0, 2*pi, num_points);
% Loop through each grid point
for i = 1:numel(x)
% Coordinates
xi = x(i);
yi = y(i);
% Only plot ellipses within the circular region
if sqrt(xi^2 + yi^2) <= R
theta = atan2(yi, xi) / 2; % Orientation of the ellipse
a = 1 - 0.05 * sqrt(xi^2 + yi^2); % Major axis length
b = 0.2 * abs(sin(2*theta)); % Minor axis length
% Parametric equation of the ellipse
X = a * cos(t);
Y = b * sin(t);
% Rotate the ellipse by angle theta
R_matrix = [cos(theta) -sin(theta); sin(theta) cos(theta)];
ellipse = R_matrix * [X; Y];
% Plot the ellipse at the point (xi, yi)
plot(xi + ellipse(1, :), yi + ellipse(2, :), 'r', 'LineWidth', 1);
end
end
% Plot the circular boundary
theta_boundary = linspace(0, 2*pi, num_points);
plot(R * cos(theta_boundary), R * sin(theta_boundary), 'k', 'LineWidth', 2);
Please refer to the following documentation link to learn more about quiver function.
Hope this helps!
  댓글 수: 3

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by