- Define the grid: Create a grid of points where you want to plot the polarization ellipses.
- Calculate the ellipse parameters: For each point on the grid, calculate the parameters of the polarization ellipse (orientation, major and minor axes).
- Plot the ellipses: Use the plot function to draw ellipses at each grid point.
How to plot the polarisation distributions in bessel poincare beam showing all singularities present in them
19 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to have a plot of normal poincare beam and bessel poincare beam as shown in the figure, does anyone know how to plot like this, Please help me![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1738541/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1738541/image.png)
0 Commenti
Risposte (1)
Milan Bansal
il 20 Lug 2024
Modificato: Milan Bansal
il 20 Lug 2024
Hi Aswathi K
You can use the quiver plot in MATLAB to plot the 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 polarization.
% Parameters
N = 30; % Number of points in each direction
radius = 5; % Radius of the outer circle
[X, Y] = meshgrid(linspace(-radius, radius, N), linspace(-radius, radius, N));
Z = X + 1i*Y;
% Plot
figure;
hold on;
axis equal;
axis off;
theta_circle = linspace(0, 2*pi, 100);
plot(radius*cos(theta_circle), radius*sin(theta_circle), 'k'); % Draw the circle boundary
for i = 1:N
for j = 1:N
if X(i,j)^2 + Y(i,j)^2 <= radius^2 % Only plot points within the circle
% Polarization states
r = sqrt(X(i,j)^2 + Y(i,j)^2);
theta = atan2(Y(i,j), X(i,j));
phi = r;
% Compute the semi-major and semi-minor
% For demonstration, let's vary the axes lengths as a function of r and theta
semi_major = 0.1 + 0.05 * sin(r);
semi_minor = 0.05 + 0.03 * cos(r);
semi_axes = [semi_major, semi_minor];
angle = 2*theta + phi; % Orientation of ellipse
color = 'r';
plot_ellipse([X(i,j), Y(i,j)], semi_axes, angle, color);
end
end
end
hold off;
% Function to plot ellipses
function plot_ellipse(center, semi_axes, angle, color)
theta = linspace(0, 2*pi, 100);
ellipse_x = semi_axes(1) * cos(theta);
ellipse_y = semi_axes(2) * sin(theta);
R = [cos(angle), -sin(angle); sin(angle), cos(angle)];
ellipse_coords = R * [ellipse_x; ellipse_y];
plot(center(1) + ellipse_coords(1, :), center(2) + ellipse_coords(2, :), color, 'LineWidth', 1);
end
The above code is only for demonstration, please modify it as per your requirement.
Please refer to the following documentation link to learn more about quiver function.
Hope this helps!
Vedere anche
Categorie
Scopri di più su Bessel functions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!