rl_raylib  1.1.10
rl_PolCSPOD Struct Reference

A Plain Ol' Data struct (POD) encapsulating the OSAC-style complex polarization amplitudes. More...

#include <rl_Polarization.h>

Public Member Functions

void init (double b_over_a=1.0, double psi=0.0)
 Initialization method. More...
 
void attenuate (double factor)
 Attenuate intensity by a factor. More...
 
double intensity () const
 Evaluate the intensity. More...
 
std::ostream & print_on (std::ostream &os) const
 Write the polarization amplitude to stream os. More...
 
void cprint_on (FILE *of) const
 Write the polarization amplitude to FILE* of. More...
 

Public Attributes

rl_Traits::complex c2_ [2]
 polarization amplitude (cosine component)
 
rl_Traits::complex s2_ [2]
 polarization amplitude (sine component)
 

Detailed Description

A Plain Ol' Data struct (POD) encapsulating the OSAC-style complex polarization amplitudes.

This is a utility POD to simplify communication with BPipe.

Relation to OSAC polarization amplitudes:

$ \mathtt{c2\_.q1} \Longleftrightarrow \mathtt{c2comp(1)}, \qquad \mathtt{c2\_.q2} \Longleftrightarrow \mathtt{c2comp(2)} $ $ \mathtt{s2\_.q1} \Longleftrightarrow \mathtt{s2comp(1)}, \qquad \mathtt{s2\_.q2} \Longleftrightarrow \mathtt{s2comp(2)} $

For random polarization:

\[ \mathtt{wt} = \mathtt{c2_.q1.r}^2 + \mathtt{c2_.q2.r}^2 + \mathtt{c2_.q1.i}^2 + \mathtt{c2_.q2.i}^2 + \mathtt{s2_.q1.r}^2 + \mathtt{s2_.q2.r}^2 + \mathtt{s2_.q1.i}^2 + \mathtt{s2_.q2.i}^2 \]

or

\[ \mathtt{wt} = \left| \mathtt{c2}[0] \right|^2 + \left| \mathtt{s2}[0] \right|^2 \]

For discrete polarization:

\[ \mathtt{wt} = \mathtt{c2_.q1.r}^2 + \mathtt{c2_.q2.r}^2 + \mathtt{c2_.q1.i}^2 + \mathtt{c2_.q2.i}^2 + \mathtt{s2_.q1.r}^2 + \mathtt{s2_.q2.r}^2 + \mathtt{s2_.q1.i}^2 + \mathtt{s2_.q2.i}^2 + 2 \left(\mathtt{c2_.q1.i} \mathtt{s2_.q1.r} + \mathtt{c2_.q2.i} \mathtt{c2_.q2.r} - \mathtt{c2_.q1.r} \mathtt{s2_.q1.i} - \mathtt{c2_.q2.r} \mathtt{c2_.q2.i} \right) \]

or

\[ \mathtt{wt} = \left| \mathtt{c2}[0] \right|^2 + \left| \mathtt{s2}[0] \right|^2 + 2 \left( \mathtt{c2}[0] \mathtt{s2}^\ast[0] + \mathtt{c2}[1] \mathtt{s2}^\ast[1] \right) \]

where the ${}^\ast$ superscript denotes a complex conjugate.

Definition at line 106 of file rl_Polarization.h.

Member Function Documentation

◆ attenuate()

void rl_PolCSPOD::attenuate ( double  factor)

Attenuate intensity by a factor.

Parameters
factorthe attenuation factor; the ray intensity is multiplied by factor.

Definition at line 121 of file rl_Polarization.cc.

◆ cprint_on()

void rl_PolCSPOD::cprint_on ( FILE *  of) const

Write the polarization amplitude to FILE* of.

The state is written out as "[(r,i)(r,i)]\n[(r,i)(r,i)]".

Parameters
ofoutput FILE*.

Definition at line 149 of file rl_Polarization.cc.

◆ init()

void rl_PolCSPOD::init ( double  b_over_a = 1.0,
double  psi = 0.0 
)

Initialization method.

Parameters
b_over_aratio of semiminor axis to semi-major axis.
psiangle of the major axis from the +X axis, with psi increasing towards +Y

Definition at line 76 of file rl_Polarization.cc.

◆ intensity()

double rl_PolCSPOD::intensity ( ) const

Evaluate the intensity.

Returns
the intensity (i.e., Stoke's $s_0$.

Definition at line 99 of file rl_Polarization.cc.

◆ print_on()

std::ostream & rl_PolCSPOD::print_on ( std::ostream &  os) const

Write the polarization amplitude to stream os.

The state is written out as "[(r,i)(r,i)][(r,i)(r,i)]".

Parameters
osoutput stream.

Definition at line 135 of file rl_Polarization.cc.


The documentation for this struct was generated from the following files: