Navigation: Scripting Reference Manual > Data Structures > T_POLARIZE2

 

T_POLARIZE2

 

Contact Us: fredsupport@photonengr.com

 

Description

Data structure the intrinsic quantities of the polarization state of a ray.

 

Definition

Type T_POLARIZE2

sAmpReal As Double

sAmpImag As Double

pAmpReal As Double

pAmpImag As Double

sX As Double

sY As Double

sZ As Double

End Type

 

Members

sAmpReal

Real part of the vector field component along the (sX,sY,sZ) vector.

 

sAmpImag

Imaginary part of the vector field component along the (sX,sY,sZ) vector.

 

pAmpReal

Real part of the vector field component perpendicular to the (sX,sY,sZ) vector.

 

pAmpImag

Imaginary part of the vector field component perpendicular to the (sX,sY,sZ) vector.

 

sX

X component of the s-vector.

 

sY

Y component of the s-vector.

 

sZ

Z component of the s-vector.

 

Notes

In general, the polarized field is defined as

 

E = Sqrt(rayflux) × (ap p + as s + ad d) × Exp[i(2p/l)×OPL]

 

where d is the ray direction, s ^ p and s x p = d,

 

ap = pAmpReal + i pAmpImag,

as = sAmpReal + i sAmpImag,

s ^ p and ad = 0 except in birefringent media.

 

The s-vector, given in the global coordinate system, is defined as the vector perpendicular to both the ray direction and the plane of incidence. The plane of incidence is the plane defined by the ray direction and the surface normal at the ray intersection point. In the case of normal incidence, the s-vector associated with a ray is maintained from its previous state.

 

The rotation direction of the polarization ellipses indicates the rotation direction as the propagation distance is fixed and time advances.  Polarization is right handed if, as time increases, the tip of the electric field vector rotates clockwise on any particular plane in space when the direction of ray propagation is toward the observer. Conversely, polarization is left handed if, as time increases, the tip of the electric field vector rotates counter-clockwise on any particular plane in space when the direction of ray propagation is toward the observer.

 

 

Example

The following script example calculates the real and imaginary components of the E-field along the S, P, global X and global Y directions using the GetPolarization2 subroutine.

 

Dim pol2 As T_POLARIZE2

Dim ray As T_RAY

Dim pi As Double

Dim sx As Double, sy As Double, sz As Double

Dim px As Double, py As Double, pz As Double

Dim dx As Double, dy As Double, dz As Double

Dim Esreal As Double, Epreal As Double, Edreal As Double

Dim Esimg As Double, Epimg As Double, Edimg As Double

Dim ExRe As Double, EyRe As Double

Dim ExIm As Double, EyIm As Double

Dim thetas As Double, thetap As Double, theta As Double, mags As Double, magp As Double

Dim iray As Long, cnt As Long

 

pi=Acos(-1)

ClearOutputWindow

 

'write header

Print "Ray ID";

Print "EsRe";

Print "EsIm";

Print "EpRe";

Print "EpIm";

Print "ExRe";

Print "ExIm";

Print "EyRe";

Print "EyIm"

 

'loop over all rays in the buffer

cnt=0

success=GetFirstRay(iray,ray)

While success

          cnt=cnt+1

 

          'retrieve the d vector, calculate p and the phase

          GetPolarization2 iray,pol2

          sx=pol2.sX : sy=pol2.sY : sz=pol2.sZ

          dx=ray.a : dy=ray.b : dz=ray.c

          CrossProd3D px, py, pz,-sx, -sy, -sz, dx, dy, dz

          theta=2*pi*ray.pathlength/(ray.wavelength*1e-3)

 

          'magnitides of s and p components

          mags=Sqr(pol2.sAmpReal^2+pol2.sAmpImag^2)

          magp=Sqr(pol2.pAmpReal^2+pol2.pAmpImag^2)

 

          'relative phase of s and p components

          thetas=Atn2(pol2.sAmpImag,pol2.sAmpReal)

          thetap=Atn2(pol2.pAmpImag,pol2.pAmpReal)

 

          'real & imaginary components in s and p directions

          Esreal=Sqr(ray.power)*mags*Cos(theta+thetas) : Esimg=Sqr(ray.power)*mags*Sin(theta+thetas)

          Epreal=Sqr(ray.power)*magp*Cos(theta+thetap) : Epimg=Sqr(ray.power)*magp*Sin(theta+thetap)

 

          'real & imaginary components in the x and y directions

          ExRe = Esreal*pol2.sX + Epreal*px

          EyRe = Esreal*pol2.sY + Epreal*py

          ExIm = Esimg*pol2.sX + Epimg*px

          EyIm = Esimg*pol2.sY + Epimg*py

 

          'print data to Output Window

          Print iray;

          Print Esreal;

          Print Esimg;

          Print Epreal;

          Print Epimg;

          Print ExRe;

          Print ExIm;

          Print EyRe;

          Print EyIm

 

          success=GetNextRay(iray,ray)

Wend

 

Used as Parameter in

GetPolarization2

SetPolarization2

 

See Also

GetRay

GetPolarization

SetPolarization

T_POLARIZE

 

 

 

 

 

Copyright © Photon Engineering, LLC