Programming Reference for VirtualLab Fusion
2025.1
|
This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Provides static conversion functions from one coordinate system to another one, among others
More...
Static Public Member Functions | |
static VectorD | ConvertWalkParameterTo2DPosition (double walkParameter, VectorD sizeOfAperture, bool isEllipticAperture) |
Converts a one-dimensional “walk parameter” to a 2D position either on an ellipse or a rectangle. | |
static double | CoordinateWithinPeriod (double coordinate, double period, double centerOfPeriod=0) |
Ensures that the given coordinate lies within -period/2 ... +period.X/2. If not it is "wrapped" into this range. | |
static Vector3D | CoordinateWithinPeriod (Vector3D coordinate, Vector3D period) |
Ensures that the given coordinate lies within (-period.X/2, -period.Y/2, 0) ... (+period.X/2, +period.Y/2, +period.Z). If not it is "wrapped" into this range. | |
static VectorD | CoordinateWithinPeriod (VectorD coordinate, VectorD period, VectorD centerOfPeriod=new VectorD()) |
Ensures that the given coordinate lies within (-period.X/2, -period.Y/2) ... (+period.X/2, +period.Y/2). If not it is "wrapped" into this range. | |
static Vector | GetCentralPixel (SamplingParameters samplingParameters) |
This method gives the central pixel, i.e. that pixel having the physical coordinate (0; 0). This implicitly assumes that the physical center is in the center of a pixel; for even sampling the pixel top right from the actual center is returned. | |
static Quaternion | GetRotationQuaternionForRotatingOneDirectionVectorToAnother (Vector3D sourceVector, Vector3D targetVector) |
The method calculates a rotation quaternion for rotating one direction vector to another. If the source vector v1 and the target vector v2 are normalized, the resulting quaternion m fulfills the equation m*v1 = v2. If the vectors are not normalized, the product of m and v1 will give a new vector with the direction of v2 and the length of v1. | |
static Quaternion | GetRotationQuaternionFromAnyCStoAnyOtherCS (CartesianCoordinateSystem sourceCS, CartesianCoordinateSystem targetCS) |
Calculates the rotation quaternion Q that transforms a coordinate x1 from one coordinate system to another via x2 = Q * x1. | |
static VectorD | PointFromPhysicalToDoublePixelCoordinates (VectorD pointInPhysical, SamplingParameters samplingParameters) |
Converts a given point in physical coordinates into a point in (double valued) pixel coordinates. | |
static Vector | PointFromPhysicalToPixelCoordinates (VectorD pointInMeters, SamplingParameters samplingParameters) |
Converts a given point in physical coordinates into a point in pixel coordinates. | |
static VectorD | PointFromPhysicalToPixelCoordinates (VectorD pointInPhysical, SamplingParameters samplingParameters, bool zeroPointInPixel) |
Converts a given point in physical coordinates into a point in (double valued) pixel coordinates. It is assumed that the physical coordinate 0 is in the center of the data. | |
static double | PointFromPixelToPhysicalCoordinates (int pointInPixels, int numberOfSamplingPoints, double samplingDistance) |
Converts a given one-dimensional point in pixel coordinates into a position in physical coordinates. | |
static double | PointFromPixelToPhysicalCoordinates (int pointInPixels, int numberOfSamplingPoints, double samplingDistance, bool zeroPointInPixel) |
Converts a given one-dimensional point in pixel coordinates into a position in physical coordinates. It is assumed that the physical coordinate 0 is in the center of the data. | |
static VectorD | PointFromPixelToPhysicalCoordinates (Vector pointInPixels, SamplingParameters samplingParameters) |
Converts a given point in pixel coordinates into a point in physical coordinates. | |
static VectorD | PointFromPixelToPhysicalCoordinates (VectorD pointInPixels, SamplingParameters samplingParameters, bool zeroPointInPixel, LocationFixation2D vertexToReturn=LocationFixation2D.Center) |
Converts a given point in (double valued) pixel coordinates into a point in physical coordinates. It is assumed that the physical coordinate 0 is in the center of the data. | |
static VectorD | PointFromPixelToPhysicalCoordinates (VectorD pointInPixels, SamplingParameters samplingParameters, LocationFixation2D vertexToReturn=LocationFixation2D.Center) |
Converts a given point in (double valued) pixel coordinates into a point in physical coordinates. | |
static Rectangle | RectangleFromPhysicalToPixelCoordinates (RectangleF rectangleInMeters, SamplingParameters samplingParameters) |
Converts a given RectangleF in physical coordinates into a Rectangle in pixel coordinates. | |
static RectangleF | RectangleFromPixelToPhysicalCoordinates (Rectangle rectangleInPixels, SamplingParameters samplingParameters) |
Converts a given Rectangle in pixel coordinates into a RectangleF in physical coordinates. | |
static RectangleF | RectangleFromPixelToPhysicalCoordinates (RectangleF rectangleInPixels, SamplingParameters samplingParameters) |
Converts a given RectangleF in pixel coordinates into a RectangleF in physical coordinates. | |
static CartesianCoordinateSystem | RotateExcentrical (CartesianCoordinateSystem csToBeRotated, Quaternion rotationQuaternion, Position rotationCenterInReferenceCS) |
Method to do a rotation of a coordinate system, but not about its own origin but about another center of rotation. | |
static SamplingParameters | SpatialSamplingToSpectralSampling (SamplingParameters samplingParameters) |
Converts a spatial sampling to a spectral sampling. Therefor, the resulting sampling is calculated from the original field size via the Fourier theorem. Works also for conversion from spectral to spatial. | |
static Vector3D | TransformAny3DCoordinates2CoordinatesDefinedInAnyOtherCS (Vector3D coordinates2Btransformed, CartesianCoordinateSystem sourceCS, CartesianCoordinateSystem targetCS) |
Transforms a given coordinate in R^3 from one coordinate system to another. | |
static CartesianCoordinateSystem | TransformAnyCS2CSdefinedInAnyOtherCS (CartesianCoordinateSystem cs2Btransformed, IProvidesPositioningReferences newPositioningReferenceProvider, string newPositioningReferenceKey) |
Transforms a given coordinate system into any other coordinate system. | |
static Vector3C | TransformAnyDirectionVector3C2DirectionVector3CDefinedInAnyOtherCS (Vector3C directionVector2Btransformed, CartesianCoordinateSystem sourceCS, CartesianCoordinateSystem targetCS) |
Transforms a given direction vector in C^3 from one coordinate system to another. Important: This operation will be restricted to a rotation of the vector and will NOT take the new coordinate system's origin into account. So the length of the vector will be kept. | |
static Vector3D | TransformAnyDirectionVector3D2DirectionVector3DDefinedInAnyOtherCS (Vector3D directionVector2Btransformed, CartesianCoordinateSystem sourceCS, CartesianCoordinateSystem targetCS) |
Transforms a given direction vector in R^3 from one coordinate system to another. Important: This operation will be restricted to a rotation of the vector and will NOT take the new coordinate system's origin into account. So the length of the vector will be kept. | |
static Position | TransformAnyPosition2PositionDefinedInAnyOtherCS (Position pos2Btransformed, IProvidesPositioningReferences newPositioningReferenceProvider, string newPositioningReferenceKey) |
Transforms a given position into any other coordinate system. | |
static Vector3D | TransformAnyPositionVector3D2PositionVector3DDefinedInAnyOtherCS (Vector3D positionVector2Btransformed, CartesianCoordinateSystem sourceCS, CartesianCoordinateSystem targetCS) |
Transforms a given position vector in R^3 from one coordinate system to another. Important: This operation will NOT be restricted to a rotation of the vector but will take the new coordinate system's origin into account. So the length of the vector may be changed. | |
static CoordinateSystemBaseVectors | TransformBasevectorsFromOneCStoAnyOtherCS (CoordinateSystemBaseVectors baseVectors, CartesianCoordinateSystem sourceCS, CartesianCoordinateSystem targetCS) |
Transforms a set of coordinate system base vectors from one CS into another. | |
static CartesianCoordinateSystem | TransformCSdefinedInGlobalsCS2LocalCS (CartesianCoordinateSystem csInGlobal, IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey) |
Transforms a coordinate system, given in relation to the global coordinate system, to one defined relative to a given reference coordinate system. | |
static PositionedLine | TransformInternalLine2LineInGlobalCS (PositionedLine localLine) |
Transforms a positioned line, given in relation to its reference coordinate system to the global coordinate system. | |
static Position | TransformInternalPosition2PositionInGlobalCS (Position internalPosition) |
Transforms a position, given in relation to its reference coordinate system to the global coordinate system (For repeated calls try to use an object of type TransformationsForCartesianCoordinateSystems.) | |
static Position | TransformInternalPosition2PositionInHigherReferenceCS (Position internalPosition) |
Transforms a position, given in relation to its reference coordinate system to the next higher reference coordinate system (For repeated calls try to use an object of type TransformationsForCartesianCoordinateSystems.) | |
static PositionedLine | TransformLineInGlobalCS2InternalLine (PositionedLine globalLine, IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey) |
Transforms a positioned line, given in relation to the global coordinate system to a reference coordinate system. | |
static CartesianCoordinateSystem | TransformLocalCS2CSdefinedInGlobalCS (CartesianCoordinateSystem localCS) |
Transforms a coordinate system, given in relation to its reference coordinate system, to one defined relative to the global coordinate system. | |
static Position | TransformPositionInGlobalCS2InternalPosition (Position externalPosition, IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey) |
Transforms a position, given in relation to the global coordinate system to a reference coordinate system. (For repeated calls try to use an object of type TransformationsForCartesianCoordinateSystems.) | |
This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Provides static conversion functions from one coordinate system to another one, among others
But be aware that in case the physical coordinate (0; 0) is not bound to the center of a pixel (which is the case for data arrays, but not for complex amplitudes), the SamplingConversions class should be used to convert between pixel and physical coordinates and vice versa.
|
static |
Converts a one-dimensional “walk parameter” to a 2D position either on an ellipse or a rectangle.
walkParameter | The (relative) walk parameter: 0 means the starting point (x_max; 0), 1 means we walked one round counterclockwise around the circumference . |
sizeOfAperture | The size of the elliptic or rectangular aperture. |
isEllipticAperture | If set to true an elliptic aperture is assumed, otherwise a rectangular one. |
|
static |
Ensures that the given coordinate lies within -period/2 ... +period.X/2. If not it is "wrapped" into this range.
coordinate | The coordinate to convert. |
period | The period which gives the range the coordinate must fit in. |
centerOfPeriod | The center of the period to get the coordinate within. |
Ensures that the given coordinate lies within (-period.X/2, -period.Y/2, 0) ... (+period.X/2, +period.Y/2, +period.Z). If not it is "wrapped" into this range.
coordinate | The coordinate to convert. |
period | The period which gives the range the coordinate must fit in. |
|
static |
Ensures that the given coordinate lies within (-period.X/2, -period.Y/2) ... (+period.X/2, +period.Y/2). If not it is "wrapped" into this range.
coordinate | The coordinate to convert. |
period | The period which gives the range the coordinate must fit in. |
centerOfPeriod | The center of the period to get the coordinate within. |
|
static |
This method gives the central pixel, i.e. that pixel having the physical coordinate (0; 0). This implicitly assumes that the physical center is in the center of a pixel; for even sampling the pixel top right from the actual center is returned.
samplingParameters | The sampling parameters (needed for conversion). |
|
static |
The method calculates a rotation quaternion for rotating one direction vector to another. If the source vector v1 and the target vector v2 are normalized, the resulting quaternion m fulfills the equation m*v1 = v2. If the vectors are not normalized, the product of m and v1 will give a new vector with the direction of v2 and the length of v1.
sourceVector | Vector to be rotated. |
targetVector | Vector to be the target of the rotation. |
|
static |
Calculates the rotation quaternion Q that transforms a coordinate x1 from one coordinate system to another via x2 = Q * x1.
sourceCS | Source coordinate system. |
targetCS | Target coordinate system. |
|
static |
Converts a given point in physical coordinates into a point in (double valued) pixel coordinates.
pointInPhysical | The point given in physical coordinates |
samplingParameters | The sampling parameters (needed for conversion) |
|
static |
Converts a given point in physical coordinates into a point in pixel coordinates.
pointInMeters | The point given in physical coordinates. |
samplingParameters | The sampling parameters (needed for conversion). |
|
static |
Converts a given point in physical coordinates into a point in (double valued) pixel coordinates. It is assumed that the physical coordinate 0 is in the center of the data.
pointInPhysical | The point given in physical coordinates |
samplingParameters | The sampling parameters (needed for conversion) |
zeroPointInPixel | If set to true the physical coordinate 0 is in the center of a pixel. This is mandatory for ComplexAmplitude and HarmonicFieldsSet objects. If set to false , this coordinate can also lie between pixels (in case of even sampling). |
|
static |
Converts a given one-dimensional point in pixel coordinates into a position in physical coordinates.
pointInPixels | The one-dimensional point given in pixel coordinates |
numberOfSamplingPoints | The number of sampling points (needed for conversion). |
samplingDistance | The sampling distance (needed for conversion). |
|
static |
Converts a given one-dimensional point in pixel coordinates into a position in physical coordinates. It is assumed that the physical coordinate 0 is in the center of the data.
pointInPixels | The one-dimensional point given in pixel coordinates |
numberOfSamplingPoints | The number of sampling points (needed for conversion). |
samplingDistance | The sampling distance (needed for conversion). |
zeroPointInPixel | If set to true the physical coordinate 0 is in the center of a pixel. This is mandatory for ComplexAmplitude and HarmonicFieldsSet objects. If set to false , this coordinate can also lie between pixels (in case of even sampling). |
|
static |
Converts a given point in pixel coordinates into a point in physical coordinates.
pointInPixels | The point given in pixel coordinates |
samplingParameters | The sampling parameters (needed for conversion) |
|
static |
Converts a given point in (double valued) pixel coordinates into a point in physical coordinates. It is assumed that the physical coordinate 0 is in the center of the data.
pointInPixels | The point given in (double valued) pixel coordinates |
samplingParameters | The sampling parameters (needed for conversion) |
vertexToReturn | Optional parameter to specify which vertex of a pixel is returned. By default the center of the pixel is returned. |
zeroPointInPixel | If set to true the physical coordinate (0; 0) is always in the center of a pixel. This is mandatory for ComplexAmplitude and HarmonicFieldsSet objects. If set to false , this coordinate can also lie between pixels (in case of even sampling). |
|
static |
Converts a given point in (double valued) pixel coordinates into a point in physical coordinates.
pointInPixels | The point given in pixel coordinates |
samplingParameters | The sampling parameters (needed for conversion) |
vertexToReturn | Optional parameter to specify which vertex of a pixel is returned. By default the center of the pixel is returned. |
|
static |
Converts a given RectangleF in physical coordinates into a Rectangle in pixel coordinates.
rectangleInMeters | The RectangleF given in physical coordinates. |
samplingParameters | The sampling parameters (needed for conversion). |
|
static |
Converts a given Rectangle in pixel coordinates into a RectangleF in physical coordinates.
rectangleInPixels | |
samplingParameters | The sampling parameters (needed for conversion) |
|
static |
Converts a given RectangleF in pixel coordinates into a RectangleF in physical coordinates.
rectangleInPixels | |
samplingParameters | The sampling parameters (needed for conversion) |
|
static |
Method to do a rotation of a coordinate system, but not about its own origin but about another center of rotation.
csToBeRotated | Coordinate system to be rotated |
rotationQuaternion | Quaternion that describes the rotation |
rotationCenterInReferenceCS | Center of rotation, defined in the reference coordinate system of the cs to be rotated. |
|
static |
Converts a spatial sampling to a spectral sampling. Therefor, the resulting sampling is calculated from the original field size via the Fourier theorem. Works also for conversion from spectral to spatial.
samplingParameters | The original sampling parameters. |
|
static |
Transforms a given coordinate in R^3 from one coordinate system to another.
coordinates2Btransformed | Vector to be transformed. |
sourceCS | Source coordinate system. |
targetCS | Target coordinate system. |
targetCS
.
|
static |
Transforms a given coordinate system into any other coordinate system.
cs2Btransformed | coordinate system to be transformed |
newPositioningReferenceProvider | reference provider of the coordinate system that shall be used as new reference |
newPositioningReferenceKey | key that identifies the coordinate system that shall be used as new reference in the reference provider class |
|
static |
Transforms a given direction vector in C^3 from one coordinate system to another. Important: This operation will be restricted to a rotation of the vector and will NOT take the new coordinate system's origin into account. So the length of the vector will be kept.
directionVector2Btransformed | Complex vector to be transformed. |
sourceCS | Source coordinate system. |
targetCS | Target coordinate system. |
targetCS
.
|
static |
Transforms a given direction vector in R^3 from one coordinate system to another. Important: This operation will be restricted to a rotation of the vector and will NOT take the new coordinate system's origin into account. So the length of the vector will be kept.
directionVector2Btransformed | Vector to be transformed. |
sourceCS | Source coordinate system. |
targetCS | Target coordinate system. |
targetCS
.
|
static |
Transforms a given position into any other coordinate system.
pos2Btransformed | position to be transformed |
newPositioningReferenceProvider | reference provider of the coordinate system that shall be used as new reference |
newPositioningReferenceKey | key that identifies the coordinate system that shall be used as new reference in the reference provider class |
|
static |
Transforms a given position vector in R^3 from one coordinate system to another. Important: This operation will NOT be restricted to a rotation of the vector but will take the new coordinate system's origin into account. So the length of the vector may be changed.
positionVector2Btransformed | Vector to be transformed. |
sourceCS | Source coordinate system. |
targetCS | Target coordinate system. |
targetCS
.
|
static |
Transforms a set of coordinate system base vectors from one CS into another.
baseVectors | Set of base vectors to be transformed. |
sourceCS | Source coordinate system. |
targetCS | Target coordinate system. |
|
static |
Transforms a coordinate system, given in relation to the global coordinate system, to one defined relative to a given reference coordinate system.
csInGlobal | Coordinate system (given in relation to the global coordinate system) to be transformed. |
positioningReferenceProvider | Object which provides the coordinate system that serves as reference for this position. |
positioningReferenceKey | Key for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position |
|
static |
Transforms a positioned line, given in relation to its reference coordinate system to the global coordinate system.
localLine | Positioned line (in relation to its reference coordinate system) to be transformed. |
Transforms a position, given in relation to its reference coordinate system to the global coordinate system (For repeated calls try to use an object of type TransformationsForCartesianCoordinateSystems.)
internalPosition | Position (in relation to its reference coordinate system) to be transformed. |
|
static |
Transforms a position, given in relation to its reference coordinate system to the next higher reference coordinate system (For repeated calls try to use an object of type TransformationsForCartesianCoordinateSystems.)
internalPosition | Position (in relation to its reference coordinate system) to be transformed. |
|
static |
Transforms a positioned line, given in relation to the global coordinate system to a reference coordinate system.
globalLine | Positioned line (in relation to the global coordinate system) to be transformed. |
positioningReferenceProvider | Object which provides the coordinate system that serves as reference for this position. |
positioningReferenceKey | Key for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position |
|
static |
Transforms a coordinate system, given in relation to its reference coordinate system, to one defined relative to the global coordinate system.
localCS | Coordinate system (given in relation to its reference coordinate system) to be transformed. |
|
static |
Transforms a position, given in relation to the global coordinate system to a reference coordinate system. (For repeated calls try to use an object of type TransformationsForCartesianCoordinateSystems.)
externalPosition | Position (in relation to the global coordinate system) to be transformed. |
positioningReferenceProvider | Object which provides the coordinate system that serves as reference for this position. |
positioningReferenceKey | Key for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position |