CartesianPoint
A metatype for representing a 3D point using Cartesian coordinates.
Attributes
Name | Type | Description |
---|---|---|
x | double |
First (x) coordinate, in m. |
y | double |
Second (y) coordinate, in m. |
z | double |
Third (z) coordinate, in m. |
frame | UnitaryTransformation or nil |
Reference frame of the coordinates if different from the simulation one or nil . |
Constructor
Synopsis
pumas.CartesianPoint(x, y, z, frame)
pumas.CartesianPoint{x=, y=, z=, frame=}
pumas.CartesianPoint(coordinates)
Note
For the two first forms the x, y, z 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 |
---|---|---|
x | number |
First (x) coordinate. |
y | number |
Second (y) coordinate. |
z | number |
Third (z) coordinate. |
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 point coordinates e.g. as returned by State.position. |
See also
CartesianVector, GeodeticPoint, HorizontalVector, LocalFrame, SphericalPoint, SphericalVector, UnitaryTransformation.
CartesianPoint.clone
Get a copy (clone) of the coordinates instance.
Synopsis
CartesianPoint:clone()
Arguments
None, except self.
Returns
Type | Description |
---|---|
CartesianPoint | Copy of the point coordinates. |
See also
CartesianPoint.get
Get the point 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
CartesianPoint: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
CartesianPoint.set
Set the point coordinates from another Coordinates instance.
Synopsis
CartesianPoint:set(coordinates)
Arguments
Name | Type | Description |
---|---|---|
coordinates | Coordinates | Input coordinates. |
Note
The input coordinates must be a point instance (CartesianPoint, GeodeticPoint, SphericalPoint) or a C array, e.g. as returned by State.position.
Returns
Type | Description |
---|---|
CartesianPoint | Reference to the updated coordinates. |
See also
CartesianPoint.transform
Transform the point coordinates to a new reference frame. The transform occurs in-place.
Synopsis
CartesianPoint: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 |
---|---|
CartesianPoint | Reference to the updated coordinates. |