Title: | The n-vector Approach to Geographical Position Calculations using an Ellipsoidal Model of Earth |
---|---|
Description: | The n-vector framework uses the normal vector to the Earth ellipsoid (called n-vector) as a non-singular position representation that turns out to be very convenient for practical position calculations. The n-vector is simple to use and gives exact answers for all global positions, and all distances, for both ellipsoidal and spherical Earth models. This package is a translation of the 'Matlab' library from FFI, the Norwegian Defence Research Establishment, as described in Gade (2010) <doi:10.1017/S0373463309990415>. |
Authors: | Enrico Spinielli [aut, cre] |
Maintainer: | Enrico Spinielli <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.4.9000 |
Built: | 2025-01-26 05:11:41 UTC |
Source: | https://github.com/euctrl-pru/nvctr |
Compute the along-track distances of a body, 'b' (for example a ground level projection position of an aircraft), from two geographical coordinates, ‘a1' and 'a2' (for example an airport’s runway thresholds), of a great circle arc.
along_track_distance(b, a1, a2)
along_track_distance(b, a1, a2)
b |
the geographical coordinates (WGS84) of a body: a vector of longitude, latitude (in decimal degrees) and eventually altitude (in meters) |
a1 |
the geographical coordinates (WGS84) of one end of a great circle arc: a vector of longitude, latitude (in decimal degrees) and eventually altitude (in meters) |
a2 |
the geographical coordinates (WGS84) of the other end of a great circle arc: a vector of longitude, latitude (in decimal degrees) and eventually altitude (in meters) |
the surface along-track distances from ‘b'’s cross-track intersection to 'a1' - 'a2'
Other utilities:
altitude_azimuth_distance()
,
cross_track_distance()
,
cross_track_intersection()
## Not run: b <- c(8.086135, 49.973942, 6401) # EDDF: 07R (longitude, latitude, altitude) a1 <- c(8.53417, 50.0275, 328) # EDDF: 25L a2 <- c(8.58653, 50.0401, 362) along_track_distance(b, a1, a2) ## End(Not run)
## Not run: b <- c(8.086135, 49.973942, 6401) # EDDF: 07R (longitude, latitude, altitude) a1 <- c(8.53417, 50.0275, 328) # EDDF: 25L a2 <- c(8.58653, 50.0401, 362) along_track_distance(b, a1, a2) ## End(Not run)
The altitude (elevation from the horizon), azimuth and distance of a point B from A are the coordinates of the Topocentric Coordinate System as typically used in astronomy to aim your telescope to a heavenly body. It can be also of use to know where an airplane is in the sky with respect to an observer on Earth.
altitude_azimuth_distance(a, b)
altitude_azimuth_distance(a, b)
a |
the observer position: a vector of longitude, latitude (in decimal degrees) and altitude (in meters) in WGS84 |
b |
the observed position: a vector of longitude, latitude (in decimal degrees) and altitude (in meters) in WGS84 |
the coordinates in North-East-Up of the observed, B, with respect to the observer A. A vector of altitude (elevation from the horizon) in decimal degrees, azimuth) in decimal degrees and distance in meters.
Other utilities:
along_track_distance()
,
cross_track_distance()
,
cross_track_intersection()
## Not run: # sensor (longitude, latitude, altitude) a <- c(49.47, 7.697, 274) # aircraft (longitude, latitude, altitude) b <- c(49.52, 7.803, 6401) altitude_azimuth_distance(a, b) ## End(Not run)
## Not run: # sensor (longitude, latitude, altitude) a <- c(49.47, 7.697, 274) # aircraft (longitude, latitude, altitude) b <- c(49.52, 7.803, 6401) altitude_azimuth_distance(a, b) ## End(Not run)
Compute the cross-track distance of a body, 'b' (for example a ground level projection position of an aircraft), from a great circle arc determined by two geographical coordinates, ‘a1' and 'a2' (for example an airport’s runway thresholds).
cross_track_distance(b, a1, a2)
cross_track_distance(b, a1, a2)
b |
the geographical coordinates (WGS84) of a body: a vector of longitude, latitude (in decimal degrees) and eventually altitude (in meters) |
a1 |
the geographical coordinates (WGS84) of one end of a great circle arc: a vector of longitude, latitude (in decimal degrees) and eventually altitude (in meters) |
a2 |
the geographical coordinates (WGS84) of the other end of a great circle arc: a vector of longitude, latitude (in decimal degrees) and eventually altitude (in meters) |
the surface cross-track distance from 'b' to the arc 'a1' - 'a2'
Other utilities:
along_track_distance()
,
altitude_azimuth_distance()
,
cross_track_intersection()
## Not run: b <- c(8.086135, 49.973942, 6401) # EDDF: 07R (longitude, latitude, altitude) a1 <- c(8.53417, 50.0275, 328) # EDDF: 25L a2 <- c(8.58653, 50.0401, 362) cross_track_distance(b, a1, a2) ## End(Not run)
## Not run: b <- c(8.086135, 49.973942, 6401) # EDDF: 07R (longitude, latitude, altitude) a1 <- c(8.53417, 50.0275, 328) # EDDF: 25L a2 <- c(8.58653, 50.0401, 362) cross_track_distance(b, a1, a2) ## End(Not run)
Calculate the cross-track intersection between the position of a body (i.e. an aircraft) and a great circle arc as defined by two points (i.e. the runway's thresholds).
cross_track_intersection(b, a1, a2)
cross_track_intersection(b, a1, a2)
b |
coordinates of the body, b: a vector of longitude, latitude (in decimal degrees) and altitude (in meters) in WGS84 |
a1 |
first coordinate of a great circle arc: a vector of longitude, latitude (in decimal degrees) and elevation (in meters) in WGS84 |
a2 |
second coordinate of a great circle arc: a vector of longitude, latitude (in decimal degrees) and elevation (in meters) in WGS84 |
The cross-track intersection between the position of a body, B, (i.e. an aircraft) and a great circle arc as defined by two points, A1 and A2, (i.e. the runway's thresholds) is the intersection, X, of the above arc with the great circle arc passing through the ground projection of B, G, and perpendicular to A1-A2.
a WGS84 vector with longitude and latitude (decimal degrees)
Other utilities:
along_track_distance()
,
altitude_azimuth_distance()
,
cross_track_distance()
## Not run: # aircraft (longitude, latitude, altitude) b <- c(8.086135, 49.973942, 6401) # EDDF: 07R (longitude, latitude, altitude) a1 <- c(8.53417, 50.0275, 328) # EDDF: 25L a2 <- c(8.58653, 50.0401, 362) cross_track_intersection(b, a1, a2) ## End(Not run)
## Not run: # aircraft (longitude, latitude, altitude) b <- c(8.086135, 49.973942, 6401) # EDDF: 07R (longitude, latitude, altitude) a1 <- c(8.53417, 50.0275, 328) # EDDF: 25L a2 <- c(8.58653, 50.0401, 362) cross_track_intersection(b, a1, a2) ## End(Not run)
Convert angle in radians to degrees
deg(radians)
deg(radians)
radians |
angle in radians. |
angle in degrees.
rad
.
deg(pi/2)
deg(pi/2)
Convert (geodetic) latitude and longitude to n-vector
lat_lon2n_E(latitude, longitude)
lat_lon2n_E(latitude, longitude)
latitude |
Geodetic latitude (rad) |
longitude |
Geodetic longitude (rad) |
n-vector decomposed in E (3x1 vector) (no unit)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
lat_lon2n_E(rad(1), rad(2))
lat_lon2n_E(rad(1), rad(2))
R_EL
from n-vector and wander azimuth angleCalculate the rotation matrix (direction cosine matrix) R_EL
using
n-vector (n_E
) and the wander azimuth angle.
When wander_azimuth = 0
, we have that N = L (See Table 2 in Gade (2010) for
details)
n_E_and_wa2R_EL(n_E, wander_azimuth)
n_E_and_wa2R_EL(n_E, wander_azimuth)
n_E |
n-vector decomposed in E (3x1 vector) (no unit) |
wander_azimuth |
The angle between L's x-axis and north, positive about L's z-axis (rad) |
The resulting rotation matrix (3x3) (no unit)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
R_EL2n_E
, R_EN2n_E
and n_E2R_EN
.
# Calculates the rotation matrix (direction cosine matrix) R_EL # using n-vector (n_E) and the wander azimuth angle. n_E <- c(1, 0, 0) (R_EL <- n_E_and_wa2R_EL(n_E, wander_azimuth = pi / 2))
# Calculates the rotation matrix (direction cosine matrix) R_EL # using n-vector (n_E) and the wander azimuth angle. n_E <- c(1, 0, 0) (R_EL <- n_E_and_wa2R_EL(n_E, wander_azimuth = pi / 2))
Convert n-vector to latitude and longitude
n_E2lat_lon(n_E)
n_E2lat_lon(n_E)
n_E |
n-vector decomposed in E (3x1 vector) (no unit) |
A vector of geodetic latitude and longitude (rad)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
n_E2lat_lon(c(1, 0, 0))
n_E2lat_lon(c(1, 0, 0))
Find the rotation matrix R_EN from n-vector
n_E2R_EN(n_E)
n_E2R_EN(n_E)
n_E |
n-vector decomposed in E (3x1 vector) (no unit) |
The resulting rotation matrix (direction cosine matrix) (no unit)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
R_EN2n_E
, n_E_and_wa2R_EL
and R_EL2n_E
.
n_E2R_EN(c(1, 0, 0))
n_E2R_EN(c(1, 0, 0))
Given the n-vectors for positions A (n_EA_E
) and B (n_EB_E
), the
output is the delta vector from A to B (p_AB_E
).
n_EA_E_and_n_EB_E2p_AB_E( n_EA_E, n_EB_E, z_EA = 0, z_EB = 0, a = 6378137, f = 1/298.257223563 )
n_EA_E_and_n_EB_E2p_AB_E( n_EA_E, n_EB_E, z_EA = 0, z_EB = 0, a = 6378137, f = 1/298.257223563 )
n_EA_E |
n-vector of position A, decomposed in E (3x1 vector) (no unit) |
n_EB_E |
n-vector of position B, decomposed in E (3x1 vector) (no unit) |
z_EA |
Depth of system A, relative to the ellipsoid (z_EA = -height) (m, default 0) |
z_EB |
Depth of system B, relative to the ellipsoid (z_EB = -height) (m, default 0) |
a |
Semi-major axis of the Earth ellipsoid (m, default [WGS-84] 6378137) |
f |
Flattening of the Earth ellipsoid (no unit, default [WGS-84] 1/298.257223563) |
The calculation is exact, taking the ellipticity of the Earth into account.
It is also nonsingular as both n-vector and p-vector are nonsingular
(except for the center of the Earth).
The default ellipsoid model used is WGS-84, but other ellipsoids (or spheres) might be specified
via the optional parameters a
and f
.
Position vector from A to B, decomposed in E (3x1 vector)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
n_EA_E_and_p_AB_E2n_EB_E
, p_EB_E2n_EB_E
and
n_EB_E2p_EB_E
lat_EA <- rad(1); lon_EA <- rad(2); z_EA <- 3 lat_EB <- rad(4); lon_EB <- rad(5); z_EB <- 6 n_EA_E <- lat_lon2n_E(lat_EA, lon_EA) n_EB_E <- lat_lon2n_E(lat_EB, lon_EB) n_EA_E_and_n_EB_E2p_AB_E(n_EA_E, n_EB_E, z_EA, z_EB)
lat_EA <- rad(1); lon_EA <- rad(2); z_EA <- 3 lat_EB <- rad(4); lon_EB <- rad(5); z_EB <- 6 n_EA_E <- lat_lon2n_E(lat_EA, lon_EA) n_EB_E <- lat_lon2n_E(lat_EB, lon_EB) n_EA_E_and_n_EB_E2p_AB_E(n_EA_E, n_EB_E, z_EA, z_EB)
Given the n-vector for position A (n_EA_E
) and the position-vector from position
A to position B (p_AB_E
), the output is the n-vector of position
B (n_EB_E
) and depth of B (z_EB
).
n_EA_E_and_p_AB_E2n_EB_E( n_EA_E, p_AB_E, z_EA = 0, a = 6378137, f = 1/298.257223563 )
n_EA_E_and_p_AB_E2n_EB_E( n_EA_E, p_AB_E, z_EA = 0, a = 6378137, f = 1/298.257223563 )
n_EA_E |
n-vector of position A, decomposed in E (3x1 vector) (no unit) |
p_AB_E |
Position vector from A to B, decomposed in E (3x1 vector) (m) |
z_EA |
Depth of system A, relative to the ellipsoid (z_EA = -height) (m, default 0) |
a |
Semi-major axis of the Earth ellipsoid (m, default [WGS-84] 6378137) |
f |
Flattening of the Earth ellipsoid (no unit, default [WGS-84] 1/298.257223563) |
The calculation is exact, taking the ellipticity of the Earth into account.
It is also nonsingular as both n-vector and p-vector are nonsingular (except for the center of the Earth). The default ellipsoid model used is WGS-84, but other ellipsoids (or spheres) might be specified.
a list with n-vector of position B, decomposed in E (3x1 vector) (no unit) and the depth of system B, relative to the ellipsoid (z_EB = -height)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
n_EA_E_and_n_EB_E2p_AB_E
, p_EB_E2n_EB_E
and
n_EB_E2p_EB_E
p_BC_B <- c(3000, 2000, 100) # Position and orientation of B is given: n_EB_E <- unit(c(1,2,3)) # unit to get unit length of vector z_EB <- -400 R_NB <- zyx2R(rad(10), rad(20), rad(30)) # yaw, pitch, and roll R_EN <- n_E2R_EN(n_EB_E) R_EB <- R_EN %*% R_NB # Decompose the delta vector in E: p_BC_E <- (R_EB %*% p_BC_B) %>% as.vector() # no transpose of R_EB, since the vector is in B # Find the position of C, using the functions that goes from one # position and a delta, to a new position: (n_EB_E <- n_EA_E_and_p_AB_E2n_EB_E(n_EB_E, p_BC_E, z_EB))
p_BC_B <- c(3000, 2000, 100) # Position and orientation of B is given: n_EB_E <- unit(c(1,2,3)) # unit to get unit length of vector z_EB <- -400 R_NB <- zyx2R(rad(10), rad(20), rad(30)) # yaw, pitch, and roll R_EN <- n_E2R_EN(n_EB_E) R_EB <- R_EN %*% R_NB # Decompose the delta vector in E: p_BC_E <- (R_EB %*% p_BC_B) %>% as.vector() # no transpose of R_EB, since the vector is in B # Find the position of C, using the functions that goes from one # position and a delta, to a new position: (n_EB_E <- n_EA_E_and_p_AB_E2n_EB_E(n_EB_E, p_BC_E, z_EB))
The function converts the position of B (typically body) relative to E (typically Earth),
the n-vector n_EB_E
to cartesian position vector ("ECEF-vector"), p_EB_E
,
in meters.
n_EB_E2p_EB_E(n_EB_E, z_EB = 0, a = 6378137, f = 1/298.257223563)
n_EB_E2p_EB_E(n_EB_E, z_EB = 0, a = 6378137, f = 1/298.257223563)
n_EB_E |
n-vector of position B, decomposed in E (3x1 vector) (no unit) |
z_EB |
Depth of system B, relative to the ellipsoid (z_EB = -height) (m, default 0) |
a |
Semi-major axis of the Earth ellipsoid (m, default [WGS-84] 6378137) |
f |
Flattening of the Earth ellipsoid (no unit, default [WGS-84] 1/298.257223563) |
The calculation is exact, taking the ellipticity of the Earth into account.
It is also nonsingular as both n-vector and p-vector are nonsingular
(except for the center of the Earth).
The default ellipsoid model used is WGS-84, but other ellipsoids (or spheres) might be specified
via the optional parameters a
and f
.
Cartesian position vector from E to B, decomposed in E (3x1 vector) (m)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
p_EB_E2n_EB_E
, n_EA_E_and_p_AB_E2n_EB_E
and
n_EA_E_and_n_EB_E2p_AB_E
.
n_EB_E <- lat_lon2n_E(rad(1), rad(2)) n_EB_E2p_EB_E(n_EB_E)
n_EB_E <- lat_lon2n_E(rad(1), rad(2)) n_EB_E2p_EB_E(n_EB_E)
nvctr provides functions to calculate geographical positions for both the ellipsoidal and spherical Earth models.
Maintainer: Enrico Spinielli [email protected] (ORCID)
Other contributors:
EUROCONTROL [copyright holder, funder]
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
Useful links:
The position of B (typically body) relative to E (typically Earth) is given as cartesian position vector p_EB_E, in meters ("ECEF-vector").
p_EB_E2n_EB_E(p_EB_E, a = 6378137, f = 1/298.257223563)
p_EB_E2n_EB_E(p_EB_E, a = 6378137, f = 1/298.257223563)
p_EB_E |
Cartesian position vector from E to B, decomposed in E (3x1 vector) (m) |
a |
Semi-major axis of the Earth ellipsoid (m, default [WGS-84] 6378137) |
f |
Flattening of the Earth ellipsoid (no unit, default [WGS-84] 1/298.257223563) |
The function converts to n-vector, n_EB_E and its depth, z_EB.
The calculation is exact, taking the ellipticity of the Earth into account. It is also nonsingular as both n-vector and p-vector are nonsingular (except for the center of the Earth). The default ellipsoid model used is WGS-84, but other ellipsoids (or spheres) might be specified.
n-vector representation of position B, decomposed in E (3x1 vector) (no unit) and depth of system B relative to the ellipsoid (z_EB = -height)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
n_EB_E2p_EB_E
, n_EA_E_and_p_AB_E2n_EB_E
and
n_EA_E_and_n_EB_E2p_AB_E
p_EB_E <- 6371e3 * c(0.9, -1, 1.1) (n_EB_E <- p_EB_E2n_EB_E(p_EB_E))
p_EB_E <- 6371e3 * c(0.9, -1, 1.1) (n_EB_E <- p_EB_E2n_EB_E(p_EB_E))
This function returns the axes of the coordinate frame E (Earth-Centered, Earth-Fixed, ECEF).
R_Ee(axes = "e")
R_Ee(axes = "e")
axes |
Either 'e' or 'E'
|
There are two choices of E-axes that are described in Table 2 in Gade (2010):
e
: z-axis points to the North Pole and x-axis points to the point where
latitude = longitude = 0. This choice is very common in many fields.
E
: x-axis points to the North Pole, y-axis points towards longitude +90deg
(east) and latitude = 0. This choice of axis directions ensures
that at zero latitude and longitude, N (North-East-Down) has the
same orientation as E. If roll/pitch/yaw are zero, also B (Body,
forward, starboard, down) has this orientation. In this manner, the
axes of E is chosen to correspond with the axes of N and B.
rotation matrix defining the axes of the coordinate frame E as described in Table 2 in Gade (2010)
Kenneth Gade (2010) A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
R_Ee()
R_Ee()
R_EL
Find n-vector from the rotation matrix (direction cosine matrix) R_EL
R_EL2n_E(R_EL)
R_EL2n_E(R_EL)
R_EL |
Rotation matrix (direction cosine matrix) (no unit) |
n-vector decomposed in E (3x1 vector) (no unit)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
n_E2R_EN
, R_EL2n_E
and n_E_and_wa2R_EL
.
R_EL <- matrix( c(-1, 0, 0, 0, 1, 0, 0, 0, -1), nrow = 3, ncol = 3, byrow = TRUE) R_EL2n_E(R_EL)
R_EL <- matrix( c(-1, 0, 0, 0, 1, 0, 0, 0, -1), nrow = 3, ncol = 3, byrow = TRUE) R_EL2n_E(R_EL)
Find n-vector from R_E
R_EN2n_E(R_EN)
R_EN2n_E(R_EN)
R_EN |
Rotation matrix (direction cosine matrix) (no unit) |
n-vector decomposed in E (3x1 vector) (no unit)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
n_E2R_EN
, R_EL2n_E
and n_E_and_wa2R_EL
.
R_EN <- matrix( c(-1, 0, 0, 0, 1, 0, 0, 0, -1), nrow = 3, ncol = 3, byrow = TRUE) R_EL2n_E(R_EN)
R_EN <- matrix( c(-1, 0, 0, 0, 1, 0, 0, 0, -1), nrow = 3, ncol = 3, byrow = TRUE) R_EL2n_E(R_EN)
The angles (called Euler angles or Tait–Bryan angles) are defined by the following procedure of successive rotations: Given two arbitrary coordinate frames A and B, consider a temporary frame T that initially coincides with A. In order to make T align with B, we first rotate T an angle x about its x-axis (common axis for both A and T). Secondly, T is rotated an angle y about the NEW y-axis of T. Finally, T is rotated an angle z about its NEWEST z-axis. The final orientation of T now coincides with the orientation of B. The signs of the angles are given by the directions of the axes and the right hand rule.
R2xyz(R_AB)
R2xyz(R_AB)
R_AB |
a 3x3 rotation matrix (direction cosine matrix) such that the relation between a vector v decomposed in A and B is given by: v_A = R_AB * v_B |
x,y,z Angles of rotation about new axes (rad)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
R_AB <- matrix( c( 0.9980212 , 0.05230407, -0.0348995 , -0.05293623, 0.99844556, -0.01744177, 0.03393297, 0.01925471, 0.99923861), nrow = 3, ncol = 3, byrow = TRUE) R2xyz(R_AB)
R_AB <- matrix( c( 0.9980212 , 0.05230407, -0.0348995 , -0.05293623, 0.99844556, -0.01744177, 0.03393297, 0.01925471, 0.99923861), nrow = 3, ncol = 3, byrow = TRUE) R2xyz(R_AB)
The 3 angles z
, y
, x
about new axes (intrinsic) in the order z-y-x are
found from the rotation matrix R_AB
. The angles (called Euler angles or
Tait–Bryan angles) are defined by the following procedure of successive rotations:
Given two arbitrary coordinate frames A and B, consider a temporary frame T that initially coincides with A. In order to make T align with B, we first rotate T an angle z about its z-axis (common axis for both A and T).
Secondly, T is rotated an angle y about the NEW y-axis of T. Finally, T is rotated an angle x about its NEWEST x-axis.
The final orientation of T now coincides with the orientation of B.
The signs of the angles are given by the directions of the axes and the right hand rule.
R2zyx(R_AB)
R2zyx(R_AB)
R_AB |
a 3x3 rotation matrix (direction cosine matrix) such that the relation between a vector v decomposed in A and B is given by: v_A = R_AB * v_B |
Note that if A is a north-east-down frame and B is a body frame, we have that z=yaw, y=pitch and x=roll.
z,y,x angles of rotation about new axes (rad)
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
zyx2R(rad(1), rad(-2), rad(-3))
zyx2R(rad(1), rad(-2), rad(-3))
Convert angle in degrees to radians.
rad(degrees)
rad(degrees)
degrees |
angle in degrees. |
angle in radians
deg
.
rad(30)
rad(30)
Make input vector unit length, i.e. norm == 1
unit(vector)
unit(vector)
vector |
a vector |
a unit length vector
unit(c(1,2,3))
unit(c(1,2,3))
The rotation matrix R_AB
is created based on 3 angles x
, y
and z
about new axes (intrinsic) in the order x-y-z.
The angles (called Euler angles or Tait-Bryan angles) are defined by the following
procedure of successive rotations:
Given two arbitrary coordinate frames A
and B
, consider a temporary frame
T
that initially coincides with A
.
In order to make T
align with B
, we first rotate T
an angle x
about its x-axis (common axis for both A
and T
).
Secondly, T
is rotated an angle y
about the NEW y-axis of T
.
Finally, codeT is rotated an angle z
about its NEWEST z-axis.
The final orientation of T
now coincides with the orientation of B
.
The signs of the angles are given by the directions of the axes and the right hand rule.
xyz2R(x, y, z)
xyz2R(x, y, z)
x |
Angle of rotation about new x axis (rad) |
y |
Angle of rotation about new y axis (rad) |
z |
Angle of rotation about new z axis (rad) |
3x3 rotation matrix (direction cosine matrix) such that the relation between a vector v decomposed in A and B is given by: v_A = R_AB * v_B
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
xyz2R(rad(10), rad(20), rad(30))
xyz2R(rad(10), rad(20), rad(30))
The rotation matrix R_AB
is created based on 3 angles z
, y
and x
about new axes (intrinsic) in the order z-y-x.
The angles (called Euler angles or Tait–Bryan angles) are defined by the following procedure
of successive rotations:
Given two arbitrary coordinate frames A and B, consider a temporary frame T that initially coincides with A. In order to make T align with B, we first rotate T an angle z about its z-axis (common axis for both A and T).
Secondly, T is rotated an angle y about the NEW y-axis of T.
Finally, T is rotated an angle x about its NEWEST x-axis. The final orientation of T now coincides with the orientation of B.
The signs of the angles are given by the directions of the axes and the right hand rule. Note that if A is a north-east-down frame and B is a body frame, we have that z=yaw, y=pitch and x=roll.
zyx2R(z, y, x)
zyx2R(z, y, x)
z |
Angle of rotation about new z axis |
y |
Angle of rotation about new y axis |
x |
Angle of rotation about new x axis |
3x3 rotation matrix R_AB (direction cosine matrix) such that the relation between a vector v decomposed in A and B is given by: v_A = R_AB * v_B
Kenneth Gade A Nonsingular Horizontal Position Representation. The Journal of Navigation, Volume 63, Issue 03, pp 395-417, July 2010.
zyx2R(rad(30), rad(20), rad(10))
zyx2R(rad(30), rad(20), rad(10))