Skip to content

Illustrate original/final polarizations with gnuplot #3

@zmitchell

Description

@zmitchell

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions