Description Calculates the 1/e2 semi-width (power) of a single coherent ray and stores the result in a T_ANALYSIS data structure. Depending on the number of rays traced, it may be necessary to dimension ray index and ray counter variables as data type Huge_ instead of Long. Please see Multi-threaded Raytracing for more information.
Syntax CoherentRaySize id, dist, size
Parameters id As Long (or Huge_) Index of the coherent ray whose size is being retrieved.
dist As Double Distance from the ray's current position at which to calculate the size. If the value of dist is zero, then the calculation is in a plane containing the ray's current position. If the value is greater than zero, the calculation is in a plane containing a point translated forward along the ray's propagation direction. If the value is less than zero, the calculation is in a plane containing a point translated opposite to the ray's propagation direction.
size As T_ANALYSIS After execution, this T_ANALYSIS structure variable contains the result of the semi-width calculation. The T_ANALYSIS parameters are returned in global coordinates. Note that the shape of the beam is not necessarily circular and may be elliptical. As a result, two semi-widths are calculated: the ellipse's semi-major axis and the semi-minor axis. If the beam is circular, then the two semi-widths will have the same value.
The position at which the coherent ray's size is evaluated is stored in the T_ANALYSIS structure members, size.posX, size.posY and size.posZ.
The T_ANALYSIS structure A and B axes vectors correspond to the coherent ray's semi-major and semi-minor axes (perpendicular to the ray direction), with lengths equal to the 1/e2 power semi-widths of the coherent ray. The GetLength3D subroutine can be called on the A and B axes to get the coherent ray's semi-width along each axis. For example, the semi-width of the coherent ray along the A axis is given by, GetLength3D size.AcellX, size.AcellY, size.AcellZ, aWidth where aWidth is a variable dimensioned in the script and used to store the result of the length calculation. Similarly, the semi-width of the coherent ray along the B axis is given by, GetLength3D size.BcellX, size.BcellY, size.BcellZ, bWidth
Example This example illustrates how the CoherentRaySize command returns the size of a specific Gaussian beamlet at a given distance from its current position. GetLength3D is also used to compute the beam major and minor semi-widths. Functionality of this example requires that a coherent source be defined and that the rays are created/traced. •Declare a T_ANALYSIS structure along with a couple of variables to hold the major and minor lengths. •Select a valid ray number and distance from the current ray position. •Issue the CoherentRaySize command to populate the T_ANALYSIS structure. •Output ray x,y,z coordinates. •Calculate lengths of major and minor ellipse axes, which correspond to the beam's semi-widths. •Print axes lengths to output window.
Dim size As T_ANALYSIS Dim majorLength As Double, minorLength As Double
'specify ray id number, distance from its current position and calculate it's size rNum = 23 dist = 0 CoherentRaySize rNum, dist, size
'print out the resulting information Print "X,Y,Z coordinates of ray " & rNum & " : " & size.posX & ", " & size.posY & ", " & size.posZ
'get the length of the size vectors GetLength3D size.AcellX, size.AcellY, size.AcellZ, majorLength GetLength3D size.BcellX, size.BcellY, size.BcellZ, minorLength
'print out information Print "Major ellipse axis length = " & majorLength Print "Minor ellipse axis length = " & minorLength
See Also
|