Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illustrate original/final polarizations with gnuplot #3

Open
zmitchell opened this issue Jun 1, 2019 · 0 comments
Open

Illustrate original/final polarizations with gnuplot #3

zmitchell opened this issue Jun 1, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@zmitchell
Copy link
Owner

If you're running a simulation to see how some elements affect a beam, it's helpful to see a visual representation of the beam.

In general the polarization is an ellipse (linear and circular polarization are special cases), so this problem boils down to using the information in the polarization vector to plot an ellipse in Gnuplot. I want to use Gnuplot because it doesn't make sense to reinvent the wheel here.

To plot an ellipse you need to know the lengths of the major and minor axes, and the angle the ellipse makes with the +x-axis. Those equations can be found in the following (free) book:
Physics of Light and Optics - Section 6.3 (PDF)

In Gnuplot you plot an ellipse as a parametric equation. The parametric equations for a rotated ellipse can be found in this post.

The Gnuplot commands to plot a single ellipse would look something like this:

r_maj = ...
r_min = ...
angle = ...
fx(t) = ...
fy(t) = ...
set parametric
set trange [0:2*pi]
plot fx(t), fy(t) title "Ellipse"
@zmitchell zmitchell added enhancement New feature or request good first issue Good for newcomers labels Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant