Class: RawVectorField<ArrayType, GridType>
Defined in: RawField.ts:605
A class representing a 2D gridded field of vectors
Extends
ExpressionVectorField<ArrayType,GridType>
Type Parameters
| Type Parameter |
|---|
ArrayType extends TypedArray |
GridType extends AutoZoomGrid |
Constructors
Constructor
new RawVectorField<
ArrayType,GridType>(grid,u_ary,v_ary,opts?):RawVectorField<ArrayType,GridType>
Defined in: RawField.ts:616
Create a vector field.
Parameters
| Parameter | Type | Description |
|---|---|---|
grid | GridType | The grid on which the vector components are defined |
u_ary | ArrayType | The u (east/west) component of the vectors, which should be given as a 1D array in row-major order, with the first element being at the lower-left corner of the grid |
v_ary | ArrayType | The v (north/south) component of the vectors, which should be given as a 1D array in row-major order, with the first element being at the lower-left corner of the grid |
opts? | RawVectorFieldOptions | Options for creating the vector field. |
Returns
RawVectorField<ArrayType, GridType>
Overrides
ExpressionVectorField.constructor
Properties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
relative_to | readonly | VectorRelativeTo | ExpressionVectorField.relative_to | RawField.ts:442 |
u | readonly | ExpressionScalarField<ArrayType, GridType> | ExpressionVectorField.u | RawField.ts:440 |
v | readonly | ExpressionScalarField<ArrayType, GridType> | ExpressionVectorField.v | RawField.ts:441 |
Methods
add()
add(
other):ComputedVectorField<ArrayType,GridType>
Defined in: RawField.ts:503
Add this vector field to another vector field. The addition occurs on the GPU if the resulting field is used in a plot component.
Parameters
| Parameter | Type | Description |
|---|---|---|
other | ExpressionVectorField<ArrayType, GridType> | Vector field to add. |
Returns
ComputedVectorField<ArrayType, GridType>
A ComputedVectorField representing the added vector field
Inherited from
divide()
divide(
other):ComputedVectorField<ArrayType,GridType>
Defined in: RawField.ts:494
Divide this vector field by a scalar. The division occurs on the GPU if the resulting field is used in a plot component.
Parameters
| Parameter | Type | Description |
|---|---|---|
other | number | ExpressionScalarField<ArrayType, GridType> | Scalar to divide by. Can be either a number or a scalar field. |
Returns
ComputedVectorField<ArrayType, GridType>
A ComputedVectorField representing the divided vector field
Inherited from
magnitude()
magnitude():
ComputedScalarField<ArrayType,GridType>
Defined in: RawField.ts:540
Get the magnitude of the vector field as a scalar field. The magnitude calculation occurs on the GPU if this field is used in a plot component.
Returns
ComputedScalarField<ArrayType, GridType>
A ComputedScalarField representing the subtracted vector field
Inherited from
ExpressionVectorField.magnitude
multiply()
multiply(
other):ComputedVectorField<ArrayType,GridType>
Defined in: RawField.ts:485
Multiply this vector field by a scalar. The multiplication occurs on the GPU if the resulting field is used in a plot component.
Parameters
| Parameter | Type | Description |
|---|---|---|
other | number | ExpressionScalarField<ArrayType, GridType> | Scalar to multiply by. Can be either a number or a scalar field. |
Returns
ComputedVectorField<ArrayType, GridType>
A ComputedVectorField representing the multiplied vector field
Inherited from
ExpressionVectorField.multiply
sampleField()
sampleField(
lon,lat): [number,number]
Defined in: RawField.ts:564
Sample this field at a given latitude and longitude.
Parameters
| Parameter | Type | Description |
|---|---|---|
lon | number | Longitude of the sample in degrees east |
lat | number | Latitude of the sample in degrees north |
Returns
[number, number]
A tuple containing the [bearing, magnitude] of the vector field at the nearest grid point. The bearing is given as degrees from north, increasing clockwise.
If the point is outside the grid, it returns [NaN, NaN] instead.
Inherited from
ExpressionVectorField.sampleField
subtract()
subtract(
other):ComputedVectorField<ArrayType,GridType>
Defined in: RawField.ts:512
Subtract another vector field from this vector field. The subtraction occurs on the GPU if the resulting field is used in a plot component.
Parameters
| Parameter | Type | Description |
|---|---|---|
other | ExpressionVectorField<ArrayType, GridType> | Vector field to subtract. |
Returns
ComputedVectorField<ArrayType, GridType>
A ComputedVectorField representing the subtracted vector field