Skip to main content

Class: ComputedVectorField<ArrayType, GridType>

Defined in: RawField.ts:636

Extends

Type Parameters

Type Parameter
ArrayType extends TypedArray
GridType extends AutoZoomGrid

Constructors

Constructor

new ComputedVectorField<ArrayType, GridType>(u, v, opts?): ComputedVectorField<ArrayType, GridType>

Defined in: RawField.ts:444

Parameters

ParameterType
uExpressionScalarField<ArrayType, GridType>
vExpressionScalarField<ArrayType, GridType>
opts?RawVectorFieldOptions

Returns

ComputedVectorField<ArrayType, GridType>

Inherited from

ExpressionVectorField.constructor

Properties

PropertyModifierTypeInherited fromDefined in
relative_toreadonlyVectorRelativeToExpressionVectorField.relative_toRawField.ts:442
ureadonlyExpressionScalarField<ArrayType, GridType>ExpressionVectorField.uRawField.ts:440
vreadonlyExpressionScalarField<ArrayType, GridType>ExpressionVectorField.vRawField.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

ParameterTypeDescription
otherExpressionVectorField<ArrayType, GridType>Vector field to add.

Returns

ComputedVectorField<ArrayType, GridType>

A ComputedVectorField representing the added vector field

Inherited from

ExpressionVectorField.add


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

ParameterTypeDescription
othernumber | 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

ExpressionVectorField.divide


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

ParameterTypeDescription
othernumber | 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

ParameterTypeDescription
lonnumberLongitude of the sample in degrees east
latnumberLatitude 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

ParameterTypeDescription
otherExpressionVectorField<ArrayType, GridType>Vector field to subtract.

Returns

ComputedVectorField<ArrayType, GridType>

A ComputedVectorField representing the subtracted vector field

Inherited from

ExpressionVectorField.subtract