HorizontalVector
A metatype for representing a 3D vector using horizontal coordinates.
Attributes
Name | Type | Description |
---|---|---|
norm | double |
Euclidian (ℓ2) norm. |
elevation | double |
Elevation angle clockwise w.r.t. the xy (horizontal) plane, in radians. |
azimuth | double |
Azimuth angle clockwise w.r.t. the y-axis (geographic north), in radians. |
frame | UnitaryTransformation or nil |
Reference frame of the coordinates if different from the simulation one or nil . |
Constructor
Synopsis
pumas.HorizontalVector(norm, elevation, azimuth, frame)
pumas.HorizontalVector{norm=, elevation=, azimuth=, frame=}
pumas.HorizontalVector(coordinates)
Note
For the two first forms the norm, elevation, azimuth and frame
arguments are optional, but for the sake of simplicity only the full forms
are reported. When an argument is missing the corresponding attribute is set
to zero or nil
.
Arguments
Name | Type | Description |
---|---|---|
norm | number |
Euclidian (ℓ2) norm. |
elevation | number |
Elevation angle clockwise w.r.t. the xy (horizontal) plane, in radians. |
azimuth | number |
Azimuth angle clockwise w.r.t. the y-axis (geographic north), in radians. |
frame | UnitaryTransformation or nil |
UnitaryTransformation representing the reference frame e.g. as returned by LocalFrame or nil if the coordinates are expressed in the simulation frame. |
coordinates | Coordinates | Other vector coordinates e.g. as returned by State.direction. |
See also
CartesianPoint, CartesianVector, GeodeticPoint, SphericalPoint, SphericalVector.
HorizontalVector.clone
Get a copy (clone) of the coordinates instance.
Synopsis
HorizontalVector:clone()
Arguments
None, except self.
Returns
Type | Description |
---|---|
HorizontalVector | Copy of the vector coordinates. |
See also
HorizontalVector.get
Get the vector coordinates in the simulation frame as a double [3]
array of
x, y and z Cartesian coordinates. The coordinates are prealably
transformed to the simulation frame if needed, e.g. if the frame attribute is
not nil
.
Synopsis
HorizontalVector:get()
Arguments
None, except self.
Returns
Type | Description |
---|---|
double [3] |
C array containing the x, y and z coordinates in the simulation frame. |
See also
HorizontalVector.set
Set the vector coordinates from another Coordinates instance.
Synopsis
HorizontalVector:set(coordinates)
Arguments
Name | Type | Description |
---|---|---|
coordinates | Coordinates | Input coordinates. |
Note
The input coordinates must be a vector instance (CartesianVector, HorizontalVector, SphericalVector) or a C array, e.g. as returned by State.direction.
Returns
Type | Description |
---|---|
HorizontalVector | Reference to the updated coordinates. |
See also
HorizontalVector.transform
Transform the vector coordinates to a new reference frame. The transform occurs in-place.
Synopsis
HorizontalVector:transform(frame)
Arguments
Name | Type | Description |
---|---|---|
frame | UnitaryTransformation or nil |
UnitaryTransformation representing the new frame or nil in order to transform to the simulation frame. |
Returns
Type | Description |
---|---|
HorizontalVector | Reference to the updated coordinates. |