This module contains all the necessary tools to convert and modify typical telemetry data.
Here, we are calling vectors, tables with three components:
{
x = number,
y = number,
z = number,
}
Tacview 1.7.2
Substracts two radian angles.
Return value:
Difference between leftAngle and rightAngle.
The result is normalized to [-pi, +pi].
Tacview 1.8.0
Converts feet distances in meters
Tacview 1.8.0
Converts nautical miles distances in meters
Tacview 1.7.2
Converts Earth spherical coordinates into cartesian coordinates. It is possible to direcly give an object transform to this function, see Telemetry.GetCurrentTransform.
Longitude and latitude are in radian. Altitude is in meter.
Return value:
A vector which is a the cartesian position in global Earth space.
Tacview 1.7.5
Converts cartesian coordinates into Earth spherical coordinates.
Return value:
A table which contains the { longitude = … , latitude = … , altitude = …}
Longitude and latitude are in radian.
Altitude is in meter.
Tacview 1.8.0
Retrieve longitude, latitude and altitude relative to given reference point.
Return value:
Position of the target point as {longitude = number , latitude = number , altitude = number}
Tacview 1.7.2
Adds two 3D vectors.
Return value:
A vector wich is the sum of vector1 and vector2.
Tacview 1.7.2
Substracts two 3D vectors.
Return value:
A vector which is the difference between vector1 and vector2.
Tacview 1.7.5
Multiplies a scalar value by a specified vector.
Return value:
Scaled vector.
Tacview 1.7.2
Normalize the given vector.
Return value:
Normalized vector.
This function is safe and a nul vector is the vector is nul.
Retrieve the length of given vector.
Retrieve the distance between given 3D cartesian points.
Retrieve the distance between the specified coordinates on earth at the given above sea level altitude.
Tacview 1.7.2
Calculate the angle between two normalized vectors.
DO NOT forget to normalize the vectors before calling GetAngle!
NOTE: If you want an accurate quadran calculation, you may want to use the function with three parameters.
Return value:
Angle in radian between the two given vectors.
Which corresponds to ArcCos( DotProduct( vector1, vector2 ) )
Tacview 1.7.2
Calculate the angle between using two normalized vectors.
DO NOT forget to normalize the vectors before calling GetAngle!
Return value:
Angle in radian between the two given vectors.
Which corresponds to ArcTan( DotProduct( vector, referenceVector1 ), DotProduct( vector, referenceVector2 ) )
Tacview 1.7.2
Converts the given point from an object local coordinates into Earth cartesian coordinates.
You can direcly pass to this function, the objectTransform table coming from Telemetry.GetCurrentTransform() where localCoordinates is a vector.
objectTransform =
{
-- If xyz are not specified, they will be calculated from longitude, latitude, and altitude.
x = cartesianPositionX, -- meters
y = cartesianPositionY, -- meters
z = cartesianPositionZ, -- meters
-- If either longitude or latitude is not specified, they will be calculated from xyz.
longitude = sphericalLongitude, -- radian
latitude = sphericalLatitude, -- radian
altitude = absoluteAltitude, -- (meters) required only if xyz are not specified
roll = objectRoll, -- radian
pitch = objectPitch, -- radian
yaw = objectYaw, -- radian
}
Return value:
coordinates as a vector in Earth global cartesian space.
returns nil if not enough data is provided.