Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
ComplexAmplitude Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class represents a complex amplitude of a wave (without time depending part) in a plane or a complex transmission function.
Both X and Y field components are stored. In general all functions are applied to both components.
The ComplexAmplitude class is used to represent globally polarized fields and transmissions, too.
The ComplexAmplitude class contains one or two ComplexField as mathematical representations for complex fields. See manual for details of physical interpretation.
The ComplexAmplitude class can contain some additional information about the radius (distance from the origin) of a spherical phase factor. Using this information field may contain a spherical phase factor that is undersampled. If the radius of the spherical phase factor is known, the whole complex amplitude at every point can be reconstructed. The radius of the spherical phase factor helps to reduce the number of sampling points. Functions that use the ComplexAmplitude class have to take into account this spherical phase information to avoid numerical errors.
Operators ( \(a+b\), \(a-b\), \(a*b\) and \(a/b\)) can be used. Passing \(a\) or \(b\) as Complex is supported. \(a^b\) can be applied for pointwise power function: \(a[x,y] ^ b\) \(b\) must be Complex. Operator \(a|b\) is used for calculation of inner product of two ComplexAmplitudes: \(a|b=\sum _{j=0}^{m}\sum _{i=0}^{n}a_{{i,j}}b_{{i,j}^{\star}}\) ( \(z^{\star}\) means conjugation of complex number.). More...

Inheritance diagram for ComplexAmplitude:
HarmonicFieldBase IDocument

Public Member Functions

void AddEqual (Complex c)
 Adds a complex number to current ComplexAmplitude. See important note on ComplexField.
 
void AddEqual (ComplexAmplitude ca)
 Adds a given ComplexAmplitude to current one taking into account the spherical phase radius. The result is stored in the present ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.
 
void ApplyAnalyticallyLinearPhaseToDataPoints_withoutResampling (CancellationToken cancellationToken)
 public support method to apply the analytically linear phase value onto the data points
 
void ApplyAnalyticallyQuadraticPhaseToDataPoints_withoutResampling (CancellationToken cancellationToken, bool enableAnalyticalLinearPhaseResultingFromOffset=false)
 public support method to apply the analytically quadratic phase value onto the data points
 
void ApplyAperture (BasicParameter.eApertureShape shape, double absoluteEdgeWidth)
 Applies an aperture function to the ca.
 
void ChangeFieldRepresentation (bool isComplex, PrecisionMode precison=PrecisionMode.Double)
 Changes field representation of current ComplexAmplitude, i.e. whether the field is complex and the PrecisionMode.
 
void ClipAmplitude (double clippingLevel)
 Sets all amplitude values of current ComplexAmplitude greater than the clippingLevel to the clippingLevel.
 
override object Clone ()
 Clones current ComplexAmplitude.
 
 ComplexAmplitude ()
 Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and 3x3 sampling points.
 
 ComplexAmplitude (ComplexAmplitude ca)
 Creates a clone of the given complex amplitude.
 
 ComplexAmplitude (HomogeneousMedium embeddingMedium)
 Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and 3x3 sampling points.
 
 ComplexAmplitude (Numerics.ComplexField field)
 Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and given ComplexField.
 
 ComplexAmplitude (Numerics.ComplexField xField, Numerics.ComplexField yField)
 Constructs a locally polarized ComplexAmplitude with the default precision, default wavelength and given X and Y Component ComplexField objects.
 
 ComplexAmplitude (SamplingParameters samplingParameters, bool IsComplex, bool initializeValues=true)
 Constructs a globally polarized ComplexAmplitude using the default wavelength from the GlobalOptions and given Numerics.SamplingParameters.
 
 ComplexAmplitude (SamplingParameters samplingParameters, PrecisionMode precision, bool IsComplex, bool initializeValues=true)
 Constructs a globally polarized ComplexAmplitude using default wavelength, and given SamplingParameters.
 
 ComplexAmplitude (SamplingParameters samplingParameters, PrecisionMode precision, bool IsComplex, Func< double, double, double > f, ParallelizationType parallelizationType=ParallelizationType.AutomaticMeasure)
 Constructs a globally polarized ComplexAmplitude using default wavelength, and given SamplingParameters. Sampling points are initialized using given real function.
 
 ComplexAmplitude (SamplingParameters samplingParameters, PrecisionMode precision, Func< double, double, Complex > f, ParallelizationType parallelizationType=ParallelizationType.AutomaticMeasure)
 Constructs a globally polarized ComplexAmplitude using default wavelength, and given SamplingParameters. Sampling points are initialized using given complex function.
The point (0 m; 0 m) will be placed in the center of the field.
 
 ComplexAmplitude (Vector SamplingPoints, bool initializeValues=true)
 Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and given number of sampling points.
 
 ComplexAmplitude (Vector SamplingPoints, Complex c)
 Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and given number of sampling points. All sampling points are set to given complex constant.
 
void Conjugate ()
 Conjugates current ComplexAmplitude.
 
void ConvertToLocallyPolarizedField ()
 Converts this instance to a locally polarized field (if this is not already the case).
 
void DivEqual (Complex c)
 Divides current ComplexAmplitude by given complex number. See important note on ComplexField.
 
void DivEqual (ComplexAmplitude ca)
 Divides current ComplexAmplitude by a given one taking into account the spherical phase radius. The result is stored in the ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.
 
void EmbedCorner (Vector newSize)
 This ComplexAmplitude is embedded into sampling points having the value zero so that the resulting size is twice the original size. In contrast to the EmbedExtract(Vector) method, this method places the original field in the bottom left quadrant of the changed field, not in the center.
 
void EmbedExtract ()
 This ComplexAmplitude is embedded centrically into sampling points having the value zero so that the resulting size is twice the original size.
 
ComplexAmplitude EmbedExtract (Rectangle rectangle)
 Embeds current complex amplitude into the given rectangle.
 
void EmbedExtract (Vector newSize)
 Changes this ComplexAmplitude to the given size.
 
override bool Equals (object otherObject, EqualityIntent equalityIntent)
 Determines whether the specified Object is equal to this instance.
 
ComplexAmplitude Extract (Vector size, Vector position)
 Extracts the defined piece from the given ComplexAmplitude.
 
ComplexAmplitude ExtractColumn (int colIndex, bool considerSphericalPhase)
 Extracts a column from the given ComplexAmplitude.
 
Complex ExtractComplexValue (VectorD position, VectorialComponent comp)
 Public method to get a complex value for a defined physical position for a specified vectorial component.
 
ComplexAmplitude ExtractDiagonal (double alpha)
 Extracts data from a diagonal line right through the center of the given ComplexAmplitude.
 
ComplexAmplitude ExtractRow (int rowIndex, bool considerSphericalPhase)
 Extracts a row from the given ComplexAmplitude.
 
void Fill (Complex c)
 Sets all pixels of this ComplexAmplitude to the given complex value.
 
void Fill (Complex c, Rectangle marker, bool inside)
 Sets all pixels of this ComplexAmplitude to the given complex value.
 
Complex GetAnalyticLinearPhaseValueAtPosition (double x, double y)
 function to get the complex value at a specific position
 
Complex GetAnalyticLinearPhaseValueAtPosition (VectorD position)
 function to get the complex value at a specific position
 
override IEnumerable< ComplexAmplitudeGetFields ()
 
VectorC GetLocalFieldVector (int x, int y)
 Gets the field vector (Ex; Ey) at a certain position (x; y) in pixels. Only works for Harmonic Fields, not Transmissions.
 
void HorizontalMirror_physicalCoordinates ()
 Performs a horizontal mirroring of current ComplexAmplitude. The physical coordinates origin is maintained.
 
void HorizontalMirror_pixelCoordinates ()
 Performs a horizontal mirroring of current ComplexAmplitude. \([SamplingPoints.X - x - 1, y] = [x, y]\).
 
void Insert (ComplexAmplitude ca, Vector position)
 Inserts the given ComplexAmplitude into current ComplexAmplitude at given position. Points exceeding boundaries will be ignored.
 
ComplexAmplitude JonesMatrixMultiplication (Matrix2x2C m)
 Multiplies a ComplexAmplitude with a Matrix2x2C.
 
void LiftPositive ()
 Lifts complex amplitude to positive. See ComplexField::LiftPositive() .
 
void ModifyComplexPart (ComplexPart complexPart, bool makeRealValuedIfSuitable=false)
 Extracts, shifts or swaps complex part of current ComplexAmplitude. Current object is modified.
 
void MultEqual (Complex c)
 Multiplies a complex number to current ComplexAmplitude. See important note on ComplexField.
 
void MultEqual (ComplexAmplitude ca)
 Multiplies a given ComplexAmplitude to current one taking into account the spherical phase radius. The result is stored in the ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.
 
void MultiplySphericalPhaseFactor (double newRadius, CancellationToken? cancellationToken=null)
 Samples a spherical phase factor with specified distance from source plane and sets the SphericalPhaseRadius property. Function uses the present sampling distance of the current ComplexAmplitude to sample spherical phase factor.
 
void Normalize ()
 Normalizes ComplexAmplitude so that the maximal amplitude is one.
 
void Normalize (Rectangle rectangle)
 Normalizes current ComplexAmplitude so that the maximal amplitude in given rectangle is one.
 
void PowerEqual (Complex c)
 Raises every element of current ComplexAmplitude to power of given complex number. See important note on ComplexField.
 
override void RemoveSphericalPhaseFactor (CancellationToken? cancellationToken=null)
 Removes a sampled spherical phase factor whose distance from the source plane is specified in the SphericalPhaseRadius property. The sampled complex field is divided by the corresponding spherical phase function.
 
void Replicate (Vector newSize, Vector shift)
 Replicates current ComplexAmplitude periodically. Old complex amplitude is replaced by new one.
 
void Replicate_Periodic (Vector newSize)
 Replicates this ComplexAmplitude periodically, original field is centered around (0; 0).
 
override void Save (string fileName)
 Saves current ComplexAmplitude into a file in binary format.
 
void SetBothComponentsAtOnce (ComplexField fieldX, ComplexField fieldY)
 Because both X and Y component must have same size, a function is needed to change both components at once.
 
void Shift (Vector shift)
 Shifts the current ComplexAmplitude by a specified number of sampling points. Size is not modified, so sampling points can get lost.
 
void SplitLocallyPolarizedField (out ComplexAmplitude caX, out ComplexAmplitude caY)
 Splits current complex amplitude into X and Y component.
 
void SubEqual (ComplexAmplitude ca)
 Subtracts a given ComplexAmplitude from current one taking into account the spherical phase radius. The result is stored in the ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.
 
void Transpose ()
 Transposes current ComplexAmplitude. This means \([x, y] = [y, x]\).
 
void VerticalMirror_physicalCoordinates ()
 Performs a vertical mirroring of current ComplexAmplitude. The physical coordinates origin is maintained.
 
void VerticalMirror_pixelCoordinates ()
 Performs a vertical mirroring of current ComplexAmplitude. \([x, SamplingPoints.Y - y - 1] = [x, y]\).
 
- Public Member Functions inherited from HarmonicFieldBase
IEnumerable< ComplexAmplitudeGetFields ()
 Gets all member fields in the harmonic field.
 
 HarmonicFieldBase ()
 Default constructor to initialize a new instance of the HarmonicFieldBase class.
 
 HarmonicFieldBase (HarmonicFieldBase field)
 Copy constructor to initialize a new instance of the HarmonicFieldBase class.
 
 HarmonicFieldBase (SerializationInfo info, StreamingContext context)
 Deserialization constructor to initialize new instance of the HarmonicFieldBase class.
 
void RemoveSphericalPhaseFactor (CancellationToken? cancellationToken=null)
 Removes the Spherical Phase Factor(s) from the field.
 
- Public Member Functions inherited from IDocument
FormDocument GetNewDocumentWindow (Form formMain, string fileName)
 Gets a new document window containing this document.
 

Static Public Member Functions

static ComplexAmplitude AddWithResampling (ComplexAmplitude cac1, ComplexAmplitude cac2, InterpolationMethod method1, InterpolationMethod method2)
 Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the second ComplexAmplitude is added to the first ComplexAmplitude.
 
static ComplexAmplitude ConvoluteWithResampling (ComplexAmplitude cac1, ComplexAmplitude cac2, InterpolationMethod method1, InterpolationMethod method2)
 Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the convolution of both ComplexAmplitude operands is performed.
 
static ComplexAmplitude Convolution (ComplexAmplitude cac1, ComplexAmplitude cac2)
 Returns convolution of \(a\) and \(b\): Convolute(a, b) := ℱ⁻¹(ℱ(a) ⋅ ℱ(b)). See important note on Numerics.ComplexField.
 
static ComplexAmplitude DefaultField (ComplexAmplitudeType fieldType=ComplexAmplitudeType.GloballyPolSpatialComplexAmplitudeField)
 Gets a default field which can be used e.g. as initial value for both the Stored Lateral Field and Stored Complete Field light source.
 
static ComplexAmplitude DivideWithResampling (ComplexAmplitude cac1, ComplexAmplitude cac2, InterpolationMethod method1, InterpolationMethod method2)
 Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the first ComplexAmplitude is divided by the second ComplexAmplitude.
 
static ComplexAmplitude MultiplyWithResampling (ComplexAmplitude cac1, ComplexAmplitude cac2, InterpolationMethod method1, InterpolationMethod method2)
 Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the second ComplexAmplitude is multiplied with the first ComplexAmplitude.
 
static ComplexAmplitude operator* (Complex c, ComplexAmplitude ca)
 Multiplies a complex value with a ComplexAmplitude.
 
static ComplexAmplitude operator* (ComplexAmplitude ca, Complex c)
 Multiplies a ComplexAmplitude with a complex value.
 
static ComplexAmplitude operator* (ComplexAmplitude cac1, ComplexAmplitude cac2)
 Multiplies two ComplexAmplitude objects.
 
static ComplexAmplitude operator+ (Complex c, ComplexAmplitude ca)
 Adds a Complex value to a ComplexAmplitude.
 
static ComplexAmplitude operator+ (ComplexAmplitude ca, Complex c)
 Adds a Complex value to a ComplexAmplitude.
 
static ComplexAmplitude operator+ (ComplexAmplitude cac1, ComplexAmplitude cac2)
 Adds two ComplexAmplitude objects. The sampling distance and the wavelength are ignored during the operation. The resulting object has the same sampling distance and wavelength as the first operand.
 
static ComplexAmplitude operator- (ComplexAmplitude ca, Complex c)
 Subtracts a ComplexAmplitude and a Complex value.
 
static ComplexAmplitude operator- (ComplexAmplitude cac1, ComplexAmplitude cac2)
 Subtracts two ComplexAmplitude objects.
 
static ComplexAmplitude operator/ (ComplexAmplitude ca, Complex c)
 Divides a ComplexAmplitude by a Complex value.
 
static ComplexAmplitude operator/ (ComplexAmplitude cac1, ComplexAmplitude cac2)
 Divides two ComplexAmplitude objects.
 
static ComplexAmplitude operator^ (ComplexAmplitude ca, Complex c)
 Raises a ComplexAmplitude to a complex value.
 
static ComplexAmplitude SubtractWithResampling (ComplexAmplitude cac1, ComplexAmplitude cac2, InterpolationMethod method1, InterpolationMethod method2)
 Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the second ComplexAmplitude is subtracted from the first ComplexAmplitude.
 

Public Attributes

VectorD SamplingDistance
 Distance between sampling points in meters.
 

Properties

Vector3D CentralDirection [get, set]
 Get and set the central direction of the field. This means a normalized Vector3D which represents an analytically stored global linear phase. If the linear phase information is represented by this CentralDirection vector, it does not have to be sampled on the data which may reduce the sampling effort. The x and y component of the vector are related to k_x and k_y of the field while the sign of its z component is related to the flag PropagatesInPositiveZDirection.
 
ComplexAmplitudeType ComplexAmplitudeType [get, set]
 Returns ComplexAmplitudeType of the present ComplexAmplitude object.
 
VectorD CoordinateOffset [get, set]
 Offset of the physical sampling point coordinates.
 
ComplexField Field [get, set]
 The complex field containing the scalar field of the globally polarized complex amplitude. In case of a locally polarized ComplexAmplitude, the X component is returned on get access. (Set access will raise an exception.)
 
override FieldRepresentation FieldRepresentation [get]
 Returns field representation of current ComplexAmplitude.
 
ComplexField FieldX [get, set]
 The complex field containing the X component of the complex amplitude.
 
ComplexField FieldY [get, set]
 The complex field containing the Y component of the complex amplitude. In case of globally polarized ComplexAmplitude using this property will throw an exception.
 
bool HasSphericalPhaseRadius [get, set]
 Indicates whether there are additionally information about the distance of a spherical phase factor from its origin. The default setting after the initialization of a new complex amplitude is false.
 
bool HasWaveParameters [get, set]
 If true then current ComplexAmplitude contains additional wave parameters like waist width, distance from waist and Rayleigh length for both axis. This parameters are necessary for the propagation. This parameter can be only true if IsComplexAmplitudeField is true. Setting HasWaveParameters to false will set WaistWidth, WaistDistance, and RayleighLength to zero. Functions that change the number of sampling points, the sampling distance or the spherical phase factor usually set this property to false.
 
bool IsComplexAmplitudeField [get]
 Returns true if complex amplitudes represents a complex amplitude.
 
bool IsGloballyPolarized [get]
 Returns true if complex amplitude is globally polarized. SET modifies Complex Amplitude Type.
 
bool IsGloballyPolarizedField [get]
 Gets whether this instance represents a globally polarized.
 
bool IsLocallyPolarized [get]
 Returns true if complex amplitude is locally polarized. SET modifies Complex Amplitude Type.
 
bool IsPeriodic [get, set]
 Specifies whether this complex amplitude is a periodic field or transmission.
 
bool IsPeriodicTransmission [get, set]
 Specifies whether this complex amplitude is a periodic transmission.
 
bool IsSignalRegion [get]
 Returns true if complex amplitudes represents a signal region.
 
override bool IsSpatial [get, set]
 Returns true if complex amplitudes is in spatial domain.
 
bool IsSpectral [get, set]
 Returns true if complex amplitudes is in spectral domain.
 
bool IsTransmission [get]
 Returns true if this complex amplitude represents a transmission.
 
Matrix2x2C JonesMatrix [get, set]
 Jones matrix for transmissions.
 
VectorC JonesVector [get, set]
 Jones vector for globally polarized complex amplitude fields.
 
LinearFunction LinearPhaseFunction [get, set]
 Function that describes the linear phase (in geometrical values). Important: The coefficients have to refer to the geometric distances instead of the phase values. That means the parameters have the meaning of k_x/k and k_y/k resp. (with k = 2π⋅n/λ). Calculating phase values require a multiplication with k = 2π⋅n/λ.
 
MeasuredQuantity MeasuredQuantityOfFieldData [get]
 Gets the measured quantity of the field data (depends on the type of the complex amplitude).
 
HomogeneousMedium Medium [get]
 Property to get the medium the field is located in.
 
double MediumWavelength [get]
 Gets the medium wavelength of the ComplexAmplitude.
 
override bool PropagatesInPositiveZDirection [get, set]
 Is the sign of the z-component of the k-vector positive or not. This flag has meaning for harmonic fields only.
 
QuadraticFunction QuadraticPhaseFunction [get, set]
 Public property to set and get the off-axis quadratic wave. Important: The coefficients have to refer to the geometric distances instead of the phase values. So the representation of a spherical wave with phase radius R would be (1/2R)*x^2 + (1/2R)*y^2 + R. Calculating phase values would require a multiplication with k = 2π⋅n/λ.
 
VectorD RayleighLength [get, set]
 Rayleigh length of the wave in X and Y direction. Note that property in part of WaveParameters struct.
 
Complex RefractiveIndex [get]
 Gets the complex refractive index of the embedding medium in which the ComplexAmplitude is defined.
 
double SamplingDistanceOneD [get, set]
 Gets or sets sampling distance of a one-dimensional ComplexAmplitude.
 
SamplingParameters SamplingParameters [get, set]
 Sets and gets the sampling parameters of the ComplexAmplitude which include sampling distance and number of sampling points. Modification of this property performs equal to changing the parameters using the SamplingDistance and SamplingPoints properties.
 
Vector SamplingPoints [get, set]
 Number of sampling points of current complex amplitude. Setting a new number of sampling points will embed the sampling points in zero samples or extract the central samples.
 
int SamplingPointsOneD [get]
 Number of sampling points of one-dimensional field. An exception will be thrown, if the field is two-dimensional.
 
double SphericalPhaseRadius [get, set]
 If there is additional information about the spherical phase (HasSphericalPhaseRadius == true) this property returns the radius of the spherical equiphase surfaces, which is equal to the distance from the definition plane of this ComplexAmplitude to the center of the spherical wave front. If hasSphericalPhaseRadius == false radius = Double.MaxValue is returned. This is similar to an infinite radius. Setting a radius using this property in the case of HasSphericalPhaseRadius == false will switch HasSphericalPhaseRadius to true. This property stores the information about an analytical spherical phase factor only, in order to reconstruct the complex amplitude, even if it is undersampled. Changing the spherical phase radius will have no effect on the sampled data but maybe an error free reconstruction of the complete complex amplitude will be impossible. To change the sampled spherical phase factor and the stored spherical phase radius at once use the functions MultiplySphericalPhaseFactor and RemoveSphericalPhaseFactor instead.
 
Complex this[int x, int y, bool accessFieldY] [get, set]
 Gets or sets a complex value with double precision on the specified position in complex amplitude. The coordinate system of x and y is the same like for ComplexField. If accessFieldY is true, the Y component is accessed by the indexer. This is allowed for locally polarized ComplexAmplitudes only. If accessFieldY is false, then the X component is accessed. For globally polarized ComplexAmplitudes this parameter has to be always false. If the precision of the ComplexField is less accurate than double precision, a loss of information is possible in case of a setting operation.
 
double WaistDistance [get, set]
 Distance of the present complex amplitude from the waist. Note that property in part of WaveParameters struct.
 
VectorD WaistWidth [get, set]
 Waist width of the wave in X and Y direction. Note that property in part of WaveParameters struct.
 
double Wavelength [get, set]
 Sets or gets the vacuum wavelength of the ComplexAmplitude.
 
WaveParameters WaveParameters [get, set]
 Get or sets all wave parameters (RayleighLength, WaistDistance and WaistWidth) at once.

 
- Properties inherited from HarmonicFieldBase
bool IsSpatial [get, set]
 Gets and sets whether the field is in spatial domain (if true) or spectral domain (if false).
 
bool PropagatesInPositiveZDirection [get, set]
 Gets or sets whether the sign of the z-component of the k-vector is positive or not.
 
- Properties inherited from IDocument
VirtualLabSession Session [get, set]
 every documents need to be handled in a session ==> default is the VirtualLab Mainsession
 
NodeVLExplorer TreeStructure [get]
 every document should have a node (maybe with subnodes) in the VirtualLab Explorer
 
DocumentType TypeOfDocument [get]
 Gets an enum entry specifying the type of the document.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class represents a complex amplitude of a wave (without time depending part) in a plane or a complex transmission function.
Both X and Y field components are stored. In general all functions are applied to both components.
The ComplexAmplitude class is used to represent globally polarized fields and transmissions, too.
The ComplexAmplitude class contains one or two ComplexField as mathematical representations for complex fields. See manual for details of physical interpretation.
The ComplexAmplitude class can contain some additional information about the radius (distance from the origin) of a spherical phase factor. Using this information field may contain a spherical phase factor that is undersampled. If the radius of the spherical phase factor is known, the whole complex amplitude at every point can be reconstructed. The radius of the spherical phase factor helps to reduce the number of sampling points. Functions that use the ComplexAmplitude class have to take into account this spherical phase information to avoid numerical errors.
Operators ( \(a+b\), \(a-b\), \(a*b\) and \(a/b\)) can be used. Passing \(a\) or \(b\) as Complex is supported. \(a^b\) can be applied for pointwise power function: \(a[x,y] ^ b\) \(b\) must be Complex. Operator \(a|b\) is used for calculation of inner product of two ComplexAmplitudes: \(a|b=\sum _{j=0}^{m}\sum _{i=0}^{n}a_{{i,j}}b_{{i,j}^{\star}}\) ( \(z^{\star}\) means conjugation of complex number.).

Constructor & Destructor Documentation

◆ ComplexAmplitude() [1/10]

ComplexAmplitude ( HomogeneousMedium  embeddingMedium)

Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and 3x3 sampling points.

Parameters
embeddingMediumThe embedding medium of the complex amplitude.

◆ ComplexAmplitude() [2/10]

ComplexAmplitude ( Vector  SamplingPoints,
bool  initializeValues = true 
)

Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and given number of sampling points.

Parameters
SamplingPointsNumber of sampling points.
initializeValuesIf this optional parameter is set to false, the field values are not initialized. Should be used only if the values are initialized immediately afterwards, but then performance is better.

◆ ComplexAmplitude() [3/10]

Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and given ComplexField.

Parameters
fieldComplex field used for initialization.

◆ ComplexAmplitude() [4/10]

Constructs a locally polarized ComplexAmplitude with the default precision, default wavelength and given X and Y Component ComplexField objects.

Parameters
xFieldX component complex field.
yFieldY component complex field.

◆ ComplexAmplitude() [5/10]

ComplexAmplitude ( Vector  SamplingPoints,
Complex  c 
)

Constructs a globally polarized ComplexAmplitude using default precision, default wavelength and given number of sampling points. All sampling points are set to given complex constant.

Parameters
SamplingPointsNumber of sampling points.
cComplex constant all points are initialized to.

◆ ComplexAmplitude() [6/10]

ComplexAmplitude ( SamplingParameters  samplingParameters,
PrecisionMode  precision,
bool  IsComplex,
Func< double, double, double >  f,
ParallelizationType  parallelizationType = ParallelizationType::AutomaticMeasure 
)

Constructs a globally polarized ComplexAmplitude using default wavelength, and given SamplingParameters. Sampling points are initialized using given real function.

Parameters
samplingParametersSampling parameter of constructed field.
precisionDesired precision.
IsComplexIf true real and imaginary part are stored but the imaginary part is zero because f is a real function. If false only the real part is stored.
fA method returning a double (the real part) and having two doubles (the physical coordinates) as input parameter.
parallelizationTypeType of the parallelization. Set it to ParallelizationType.NoParallelization if the method passed by the function is not thread-safe. Otherwise you can choose of the remaining parallelization types (ParallelizationType.AutomaticMeasure is the default).

◆ ComplexAmplitude() [7/10]

ComplexAmplitude ( SamplingParameters  samplingParameters,
bool  IsComplex,
bool  initializeValues = true 
)

Constructs a globally polarized ComplexAmplitude using the default wavelength from the GlobalOptions and given Numerics.SamplingParameters.

Parameters
samplingParametersSampling parameter of constructed field.
IsComplexIf true real and imaginary part are stored. If false only the real part is stored.


Parameters
initializeValuesIf this optional parameter is set to false, the field values are not initialized. Should be used only if the values are initialized immediately afterwards, but then performance is better.

◆ ComplexAmplitude() [8/10]

ComplexAmplitude ( SamplingParameters  samplingParameters,
PrecisionMode  precision,
bool  IsComplex,
bool  initializeValues = true 
)

Constructs a globally polarized ComplexAmplitude using default wavelength, and given SamplingParameters.

Parameters
samplingParametersSampling parameter of constructed field.
precisionDesired precision.
IsComplexIf true real and imaginary part are stored but the imaginary part is zero because f is a real function. If false only the real part is stored.


Parameters
initializeValuesIf this optional parameter is set to false, the field values are not initialized. Should be used only if the values are initialized immediately afterwards, but then performance is better.

◆ ComplexAmplitude() [9/10]

ComplexAmplitude ( SamplingParameters  samplingParameters,
PrecisionMode  precision,
Func< double, double, Complex f,
ParallelizationType  parallelizationType = ParallelizationType::AutomaticMeasure 
)

Constructs a globally polarized ComplexAmplitude using default wavelength, and given SamplingParameters. Sampling points are initialized using given complex function.
The point (0 m; 0 m) will be placed in the center of the field.

Parameters
samplingParametersSampling parameter of constructed field.
precisionDesired precision.
fA method returning a Complex (the field value) and having two doubles (the physical coordinates) as input parameter.
parallelizationTypeType of the parallelization. Set it to ParallelizationType.NoParallelization if the method passed by the function is not thread-safe. Otherwise you can choose of the remaining parallelization types (ParallelizationType.AutomaticMeasure is the default).

◆ ComplexAmplitude() [10/10]

Creates a clone of the given complex amplitude.

Parameters
cathe complex amplitude to be cloned

Member Function Documentation

◆ AddEqual() [1/2]

void AddEqual ( Complex  c)

Adds a complex number to current ComplexAmplitude. See important note on ComplexField.

Parameters
cComplex number to be added.

◆ AddEqual() [2/2]

void AddEqual ( ComplexAmplitude  ca)

Adds a given ComplexAmplitude to current one taking into account the spherical phase radius. The result is stored in the present ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.

Parameters
caComplexAmplitude to be added to current one.

◆ AddWithResampling()

static ComplexAmplitude AddWithResampling ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2,
InterpolationMethod  method1,
InterpolationMethod  method2 
)
static

Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the second ComplexAmplitude is added to the first ComplexAmplitude.

Parameters
cac1First ComplexAmplitude operand.
cac2Second ComplexAmplitude operand.
method1How to interpolate 1. operand, if it is a transmission
method2How to interpolate 2. operand, if it is a transmission
Returns
The resulting harmonic field.

◆ ApplyAnalyticallyLinearPhaseToDataPoints_withoutResampling()

void ApplyAnalyticallyLinearPhaseToDataPoints_withoutResampling ( CancellationToken  cancellationToken)

public support method to apply the analytically linear phase value onto the data points

Parameters
cancellationTokenThe token for cooperative task cancellation.

◆ ApplyAnalyticallyQuadraticPhaseToDataPoints_withoutResampling()

void ApplyAnalyticallyQuadraticPhaseToDataPoints_withoutResampling ( CancellationToken  cancellationToken,
bool  enableAnalyticalLinearPhaseResultingFromOffset = false 
)

public support method to apply the analytically quadratic phase value onto the data points

Parameters
cancellationTokenThe token for cooperative task cancellation.
enableAnalyticalLinearPhaseResultingFromOffsetIf true, the underlying CA may contain an additional analytical linear phase, which results from the quadratic phase if there is a lateral offset.

◆ ApplyAperture()

void ApplyAperture ( BasicParameter::eApertureShape  shape,
double  absoluteEdgeWidth 
)

Applies an aperture function to the ca.

Parameters
shapeThe shape of the aperture to be applied.
absoluteEdgeWidthThe absolute edge width to be applied.

◆ ChangeFieldRepresentation()

void ChangeFieldRepresentation ( bool  isComplex,
PrecisionMode  precison = PrecisionMode::Double 
)

Changes field representation of current ComplexAmplitude, i.e. whether the field is complex and the PrecisionMode.

Parameters
isComplexComplexAmplitude is complex.
precisonNo longer necessary.

◆ ClipAmplitude()

void ClipAmplitude ( double  clippingLevel)

Sets all amplitude values of current ComplexAmplitude greater than the clippingLevel to the clippingLevel.

Parameters
clippingLevelMaximal value of amplitude.

◆ Clone()

override object Clone ( )

Clones current ComplexAmplitude.

Returns
A deep copy of this complex amplitude.

◆ ConvoluteWithResampling()

static ComplexAmplitude ConvoluteWithResampling ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2,
InterpolationMethod  method1,
InterpolationMethod  method2 
)
static

Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the convolution of both ComplexAmplitude operands is performed.

Parameters
cac1First ComplexAmplitude operand.
cac2Second ComplexAmplitude operand.
method1How to interpolate 1. operand, if it is a transmission
method2How to interpolate 2. operand, if it is a transmission
Returns
The resulting harmonic field.

◆ Convolution()

static ComplexAmplitude Convolution ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2 
)
static

Returns convolution of \(a\) and \(b\): Convolute(a, b) := ℱ⁻¹(ℱ(a) ⋅ ℱ(b)). See important note on Numerics.ComplexField.

Parameters
cac1Operator \(a\).
cac2Operator \(b\).
Returns
Result of operation.

◆ DefaultField()

Gets a default field which can be used e.g. as initial value for both the Stored Lateral Field and Stored Complete Field light source.

Parameters
fieldTypeOptional type of the field (transmission, spatial harmonic field and so on). If not specified, a globally polarized spatial field is generated. In case of a transmission a periodic transmission is returned.
Returns
A field with 5 × 5 sampling points and the given type.

◆ DivEqual() [1/2]

void DivEqual ( Complex  c)

Divides current ComplexAmplitude by given complex number. See important note on ComplexField.

Parameters
cComplex number current is to be divided by.

◆ DivEqual() [2/2]

void DivEqual ( ComplexAmplitude  ca)

Divides current ComplexAmplitude by a given one taking into account the spherical phase radius. The result is stored in the ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.

Parameters
caComplexAmplitude current one is divided by.

◆ DivideWithResampling()

static ComplexAmplitude DivideWithResampling ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2,
InterpolationMethod  method1,
InterpolationMethod  method2 
)
static

Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the first ComplexAmplitude is divided by the second ComplexAmplitude.

Parameters
cac1First ComplexAmplitude operand (dividend).
cac2Second ComplexAmplitude operand (divisor).
method1How to interpolate 1. operand, if it is a transmission
method2How to interpolate 2. operand, if it is a transmission
Returns
The resulting harmonic field.

◆ EmbedCorner()

void EmbedCorner ( Vector  newSize)

This ComplexAmplitude is embedded into sampling points having the value zero so that the resulting size is twice the original size. In contrast to the EmbedExtract(Vector) method, this method places the original field in the bottom left quadrant of the changed field, not in the center.

Parameters
newSizeNew size in pixels.

◆ EmbedExtract() [1/2]

ComplexAmplitude EmbedExtract ( Rectangle  rectangle)

Embeds current complex amplitude into the given rectangle.

Parameters
rectangleRegion to extract. Pixels outside of this ComplexAmplitude are set to zero.
Returns
Modified ComplexAmplitude.

◆ EmbedExtract() [2/2]

void EmbedExtract ( Vector  newSize)

Changes this ComplexAmplitude to the given size.

Parameters
newSizeNew size in pixels. If the new size is larger than the original number of sampling points, the field is embedded centrically into sampling points having the value zero. If the size is smaller than the the original number of sampling points, the central region of the field is extracted.

◆ Equals()

override bool Equals ( object  otherObject,
EqualityIntent  equalityIntent 
)

Determines whether the specified Object is equal to this instance.

Parameters
otherObjectThe Object to compare with this instance.
equalityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or just physical equality.
Returns
true if the specified Object is equal to this instance; otherwise, false.

◆ Extract()

ComplexAmplitude Extract ( Vector  size,
Vector  position 
)

Extracts the defined piece from the given ComplexAmplitude.

Parameters
sizeThe size of the region to extract in pixels.
positionThe zero-position of the region to extract in pixel coordinates.
Returns
Extracted region as a new ComplexAmplitude.

◆ ExtractColumn()

ComplexAmplitude ExtractColumn ( int  colIndex,
bool  considerSphericalPhase 
)

Extracts a column from the given ComplexAmplitude.

Parameters
colIndexindex of the column to extract in pixel coordinates.
considerSphericalPhaseTrue: The analytical spherical phase factor is sampled in the resulting field. False: The analytical spherical phase factor is not present in the resulting field.
Returns
Extracted column as a new ComplexAmplitude.

◆ ExtractComplexValue()

Complex ExtractComplexValue ( VectorD  position,
VectorialComponent  comp 
)

Public method to get a complex value for a defined physical position for a specified vectorial component.

Parameters
positionthe position where the value have to be extracted
compthe vectorial component which shall be used
Returns
the complex value on the defined position

◆ ExtractDiagonal()

ComplexAmplitude ExtractDiagonal ( double  alpha)

Extracts data from a diagonal line right through the center of the given ComplexAmplitude.

Parameters
alphaThe orientation angle of the diagonal line in radians. A angle of zero means that a line in x-direction is extracted. An angle of \(\frac{\pi}{2}\) means that a line in y-direction is extracted.
Returns
Extracted data as new one-dimensional ComplexAmplitude.

◆ ExtractRow()

ComplexAmplitude ExtractRow ( int  rowIndex,
bool  considerSphericalPhase 
)

Extracts a row from the given ComplexAmplitude.

Parameters
rowIndexindex of the row to extract in pixel coordinates.
considerSphericalPhaseTrue: The analytical spherical phase factor is sampled in the resulting field. False: The analytical spherical phase factor is not present in the resulting field.
Returns
Extracted row as a new one-dimensional ComplexAmplitude.

◆ Fill() [1/2]

void Fill ( Complex  c)

Sets all pixels of this ComplexAmplitude to the given complex value.

Parameters
cComplex value to fill the field with.

◆ Fill() [2/2]

void Fill ( Complex  c,
Rectangle  marker,
bool  inside 
)

Sets all pixels of this ComplexAmplitude to the given complex value.

Parameters
markerMarker that decides where to fill.
cComplex value to fill the field with.
insideFill inside or outside of the marker.

◆ GetAnalyticLinearPhaseValueAtPosition() [1/2]

Complex GetAnalyticLinearPhaseValueAtPosition ( double  x,
double  y 
)

function to get the complex value at a specific position

Parameters
xx-position
yy-position
Returns
the complex value for the analytically stored linear phase at the specified position

◆ GetAnalyticLinearPhaseValueAtPosition() [2/2]

Complex GetAnalyticLinearPhaseValueAtPosition ( VectorD  position)

function to get the complex value at a specific position

Parameters
positionthe position where the linear phase should be evaluated
Returns
the complex value for the analytically stored linear phase at the specified position

◆ GetLocalFieldVector()

VectorC GetLocalFieldVector ( int  x,
int  y 
)

Gets the field vector (Ex; Ey) at a certain position (x; y) in pixels. Only works for Harmonic Fields, not Transmissions.

Parameters
xThe x-position in pixels.
yThe y-position in pixels.
Returns
The local field vector (Ex; Ey).

◆ Insert()

void Insert ( ComplexAmplitude  ca,
Vector  position 
)

Inserts the given ComplexAmplitude into current ComplexAmplitude at given position. Points exceeding boundaries will be ignored.

Parameters
caComplex amplitude to be inserted.
positionPosition at which the field is to be inserted.

◆ JonesMatrixMultiplication()

ComplexAmplitude JonesMatrixMultiplication ( Matrix2x2C  m)

Multiplies a ComplexAmplitude with a Matrix2x2C.

Parameters
mThe complex transformation matrix.
Returns
ComplexAmplitude multiplied with the given matrix.

◆ ModifyComplexPart()

void ModifyComplexPart ( ComplexPart  complexPart,
bool  makeRealValuedIfSuitable = false 
)

Extracts, shifts or swaps complex part of current ComplexAmplitude. Current object is modified.

Parameters
complexPartNumerics.ComplexPart enum defining the desired action.
makeRealValuedIfSuitableIf this optional parameter is set to true the field is made real-valued if the imaginary part is zeroized. This is e.g. the case for extract amplitude and shift phase to real.

◆ MultEqual() [1/2]

void MultEqual ( Complex  c)

Multiplies a complex number to current ComplexAmplitude. See important note on ComplexField.

Parameters
cComplex number to be multiplied.

◆ MultEqual() [2/2]

void MultEqual ( ComplexAmplitude  ca)

Multiplies a given ComplexAmplitude to current one taking into account the spherical phase radius. The result is stored in the ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.

Parameters
caComplexAmplitude to be multiplied with current one.

◆ MultiplySphericalPhaseFactor()

void MultiplySphericalPhaseFactor ( double  newRadius,
CancellationToken?  cancellationToken = null 
)

Samples a spherical phase factor with specified distance from source plane and sets the SphericalPhaseRadius property. Function uses the present sampling distance of the current ComplexAmplitude to sample spherical phase factor.

Parameters
newRadiusDistance of the spherical phase factor from origin plane.
cancellationTokenOptional token for cooperative task cancellation.

◆ MultiplyWithResampling()

static ComplexAmplitude MultiplyWithResampling ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2,
InterpolationMethod  method1,
InterpolationMethod  method2 
)
static

Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the second ComplexAmplitude is multiplied with the first ComplexAmplitude.

Parameters
cac1First ComplexAmplitude operand.
cac2Second ComplexAmplitude operand.
method1How to interpolate 1. operand, if it is a transmission
method2How to interpolate 2. operand, if it is a transmission
Returns
The resulting harmonic field.

◆ Normalize()

void Normalize ( Rectangle  rectangle)

Normalizes current ComplexAmplitude so that the maximal amplitude in given rectangle is one.

Parameters
rectangleRegion to which normalization refers.

◆ operator*() [1/3]

static ComplexAmplitude operator* ( Complex  c,
ComplexAmplitude  ca 
)
static

Multiplies a complex value with a ComplexAmplitude.

Parameters
cThe complex value.
caThe ComplexAmplitude.
Returns
The product of the ComplexAmplitude and the complex value.

◆ operator*() [2/3]

static ComplexAmplitude operator* ( ComplexAmplitude  ca,
Complex  c 
)
static

Multiplies a ComplexAmplitude with a complex value.

Parameters
caThe ComplexAmplitude.
cThe complex value.
Returns
The product of the ComplexAmplitude and the complex value.

◆ operator*() [3/3]

static ComplexAmplitude operator* ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2 
)
static

Multiplies two ComplexAmplitude objects.

Parameters
cac1First ComplexAmplitude operand.
cac2Second ComplexAmplitude operand.
Returns
Product of the two ComplexAmplitude objects.

◆ operator+() [1/3]

static ComplexAmplitude operator+ ( Complex  c,
ComplexAmplitude  ca 
)
static

Adds a Complex value to a ComplexAmplitude.

Parameters
cThe complex value.
caThe ComplexAmplitude.
Returns
A new ComplexAmplitude where the given Complex value has been added to every pixel.

◆ operator+() [2/3]

static ComplexAmplitude operator+ ( ComplexAmplitude  ca,
Complex  c 
)
static

Adds a Complex value to a ComplexAmplitude.

Parameters
caThe ComplexAmplitude.
cThe complex value.
Returns
A new ComplexAmplitude where the given Complex value has been added to every pixel.

◆ operator+() [3/3]

static ComplexAmplitude operator+ ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2 
)
static

Adds two ComplexAmplitude objects. The sampling distance and the wavelength are ignored during the operation. The resulting object has the same sampling distance and wavelength as the first operand.

Parameters
cac1First ComplexAmplitude operand.
cac2Second ComplexAmplitude operand.
Returns
The result of the operator.

◆ operator-() [1/2]

static ComplexAmplitude operator- ( ComplexAmplitude  ca,
Complex  c 
)
static

Subtracts a ComplexAmplitude and a Complex value.

Parameters
caThe ComplexAmplitude.
cThe complex value.
Returns
The difference of the ComplexAmplitude and the complex value.

◆ operator-() [2/2]

static ComplexAmplitude operator- ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2 
)
static

Subtracts two ComplexAmplitude objects.

Parameters
cac1First ComplexAmplitude operand (minuend).
cac2Second ComplexAmplitude operand (subtrahend).
Returns
The result of the operator.

◆ operator/() [1/2]

static ComplexAmplitude operator/ ( ComplexAmplitude  ca,
Complex  c 
)
static

Divides a ComplexAmplitude by a Complex value.

Parameters
caThe ComplexAmplitude.
cThe complex value.
Returns
The quotient of the ComplexAmplitude and the complex value.

◆ operator/() [2/2]

static ComplexAmplitude operator/ ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2 
)
static

Divides two ComplexAmplitude objects.

Parameters
cac1First ComplexAmplitude operand (dividend).
cac2Second ComplexAmplitude operand (divisor).
Returns
Quotient of the two ComplexAmplitude objects.

◆ operator^()

static ComplexAmplitude operator^ ( ComplexAmplitude  ca,
Complex  c 
)
static

Raises a ComplexAmplitude to a complex value.

Parameters
cathe first ComplexAmplitude
cthe complex value
Returns
the power .

◆ PowerEqual()

void PowerEqual ( Complex  c)

Raises every element of current ComplexAmplitude to power of given complex number. See important note on ComplexField.

Parameters
cComplex exponent complex amplitude is raised to.

◆ RemoveSphericalPhaseFactor()

override void RemoveSphericalPhaseFactor ( CancellationToken?  cancellationToken = null)

Removes a sampled spherical phase factor whose distance from the source plane is specified in the SphericalPhaseRadius property. The sampled complex field is divided by the corresponding spherical phase function.

Parameters
cancellationTokenOptional token for cooperative task cancellation.

◆ Replicate()

void Replicate ( Vector  newSize,
Vector  shift 
)

Replicates current ComplexAmplitude periodically. Old complex amplitude is replaced by new one.

Parameters
newSizeNew size in pixels.
shiftIntroduces a shift in pixels. If the shift is zero then the left bottom corner of the field to replicate is in the left bottom corner of the replicated field. Else the replication starts with the sampling point of the field to replicate with the position shift on the left bottom corner of the replicated field. Shift must be between (0,0) and (Nx -1, Ny - 1). Nx and Ny are the number of sampling points in x- and y-direction.

◆ Replicate_Periodic()

void Replicate_Periodic ( Vector  newSize)

Replicates this ComplexAmplitude periodically, original field is centered around (0; 0).

Parameters
newSizeNew size in pixels.

◆ Save()

override void Save ( string  fileName)

Saves current ComplexAmplitude into a file in binary format.

Parameters
fileNameComplete path of file.

◆ SetBothComponentsAtOnce()

void SetBothComponentsAtOnce ( ComplexField  fieldX,
ComplexField  fieldY 
)

Because both X and Y component must have same size, a function is needed to change both components at once.

Parameters
fieldXComplex field containing X component.
fieldYComplex field containing Y component.

◆ Shift()

void Shift ( Vector  shift)

Shifts the current ComplexAmplitude by a specified number of sampling points. Size is not modified, so sampling points can get lost.

Parameters
shiftField shift in pixels.

◆ SplitLocallyPolarizedField()

void SplitLocallyPolarizedField ( out ComplexAmplitude  caX,
out ComplexAmplitude  caY 
)

Splits current complex amplitude into X and Y component.

Parameters
caXReturns new complex field containing X component of current ComplexAmplitude by reference.
caYReturns new complex field containing Y component of current ComplexAmplitude by reference.

◆ SubEqual()

void SubEqual ( ComplexAmplitude  ca)

Subtracts a given ComplexAmplitude from current one taking into account the spherical phase radius. The result is stored in the ComplexAmplitude. Both operands must have same number of sampling points. Other parameters like sampling distance or wavelength will not be changed. See important note on ComplexField.

Parameters
caComplexAmplitude to be subtracted from current one.

◆ SubtractWithResampling()

static ComplexAmplitude SubtractWithResampling ( ComplexAmplitude  cac1,
ComplexAmplitude  cac2,
InterpolationMethod  method1,
InterpolationMethod  method2 
)
static

Checks both ComplexAmplitude operands for identical sampling parameters, does the interpolation if one or both operands have to be resampled, then the second ComplexAmplitude is subtracted from the first ComplexAmplitude.

Parameters
cac1First ComplexAmplitude operand (minuend).
cac2Second ComplexAmplitude operand (subtrahend).
method1How to interpolate 1. operand, if it is a transmission
method2How to interpolate 2. operand, if it is a transmission
Returns
The resulting harmonic field.

Property Documentation

◆ FieldRepresentation

override FieldRepresentation FieldRepresentation
get

Returns field representation of current ComplexAmplitude.

Returns
.

◆ IsGloballyPolarizedField

bool IsGloballyPolarizedField
get

Gets whether this instance represents a globally polarized.


◆ MeasuredQuantityOfFieldData

MeasuredQuantity MeasuredQuantityOfFieldData
get

Gets the measured quantity of the field data (depends on the type of the complex amplitude).


◆ SphericalPhaseRadius

double SphericalPhaseRadius
getset

If there is additional information about the spherical phase (HasSphericalPhaseRadius == true) this property returns the radius of the spherical equiphase surfaces, which is equal to the distance from the definition plane of this ComplexAmplitude to the center of the spherical wave front. If hasSphericalPhaseRadius == false radius = Double.MaxValue is returned. This is similar to an infinite radius. Setting a radius using this property in the case of HasSphericalPhaseRadius == false will switch HasSphericalPhaseRadius to true. This property stores the information about an analytical spherical phase factor only, in order to reconstruct the complex amplitude, even if it is undersampled. Changing the spherical phase radius will have no effect on the sampled data but maybe an error free reconstruction of the complete complex amplitude will be impossible. To change the sampled spherical phase factor and the stored spherical phase radius at once use the functions MultiplySphericalPhaseFactor and RemoveSphericalPhaseFactor instead.

Exceptions
ArgumentExceptionThrown if the spherical phase radius is set to zero.

◆ this[int x, int y, bool accessFieldY]

Complex this[int x, int y, bool accessFieldY]
getset

Gets or sets a complex value with double precision on the specified position in complex amplitude. The coordinate system of x and y is the same like for ComplexField. If accessFieldY is true, the Y component is accessed by the indexer. This is allowed for locally polarized ComplexAmplitudes only. If accessFieldY is false, then the X component is accessed. For globally polarized ComplexAmplitudes this parameter has to be always false. If the precision of the ComplexField is less accurate than double precision, a loss of information is possible in case of a setting operation.

Parameters
xX position in pixel.
yY position in pixel.
accessFieldYAccess Y component field.
Returns
Complex value at position (x, y).