From 19934e239ad87421a34d0af95f31bd2df112bdf8 Mon Sep 17 00:00:00 2001 From: ezzatron Date: Tue, 28 May 2024 08:31:57 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ezzatron?= =?UTF-8?q?/nvector-js@ff53700f9e320cfe33d8e457143879321410d5cd=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/navigation.js | 2 +- assets/search.js | 2 +- functions/R2xyz.html | 18 ------- functions/R2zyx.html | 20 -------- functions/R_EL2n_E.html | 5 -- functions/R_EN2n_E.html | 5 -- functions/apply.html | 8 ++-- functions/cross.html | 10 ++-- functions/deg.html | 5 -- functions/degrees.html | 5 ++ functions/{xyz2R.html => delta.html} | 30 +++++------- functions/destination.html | 10 ++++ functions/dot.html | 6 +-- functions/eulerXYZToRotationMatrix.html | 7 +++ ...x2R.html => eulerZYXToRotationMatrix.html} | 25 +++------- functions/fromECEF.html | 8 ++++ functions/fromGeodeticCoordinates.html | 7 +++ functions/fromRotationMatrix.html | 8 ++++ functions/lat_long2n_E.html | 7 --- functions/multiply.html | 10 ++-- functions/n_E2R_EN.html | 6 --- functions/n_E2lat_long.html | 6 --- functions/n_EA_E_and_n_EB_E2p_AB_E.html | 17 ------- functions/n_EA_E_and_p_AB_E2n_EB_E.html | 16 ------- functions/n_EB_E2p_EB_E.html | 17 ------- functions/n_E_and_wa2R_EL.html | 10 ---- functions/norm.html | 4 +- functions/normalize.html | 5 ++ functions/p_EB_E2n_EB_E.html | 18 ------- functions/rad.html | 5 -- functions/radians.html | 5 ++ functions/rotate.html | 5 -- functions/rotationMatrixToEulerXYZ.html | 5 ++ functions/rotationMatrixToEulerZYX.html | 5 ++ functions/sphere.html | 4 ++ functions/toECEF.html | 8 ++++ functions/toGeodeticCoordinates.html | 6 +++ functions/toRotationMatrix.html | 6 +++ .../toRotationMatrixUsingWanderAzimuth.html | 7 +++ functions/transform.html | 5 ++ functions/transpose.html | 8 ++-- functions/unit.html | 5 -- index.html | 28 ++++++----- modules.html | 47 +++++++++---------- types/Ellipsoid.html | 7 +-- types/{Matrix3x3.html => Matrix.html} | 4 +- types/{Vector3.html => Vector.html} | 4 +- variables/GRS_80.html | 2 +- variables/R_Ee_NP_X.html | 10 ---- variables/R_Ee_NP_Z.html | 6 --- variables/WGS_72.html | 2 +- variables/WGS_84.html | 2 +- variables/WGS_84_SPHERE.html | 3 -- variables/X_AXIS_NORTH.html | 10 ++++ variables/Z_AXIS_NORTH.html | 6 +++ 55 files changed, 208 insertions(+), 294 deletions(-) delete mode 100644 functions/R2xyz.html delete mode 100644 functions/R2zyx.html delete mode 100644 functions/R_EL2n_E.html delete mode 100644 functions/R_EN2n_E.html delete mode 100644 functions/deg.html create mode 100644 functions/degrees.html rename functions/{xyz2R.html => delta.html} (62%) create mode 100644 functions/destination.html create mode 100644 functions/eulerXYZToRotationMatrix.html rename functions/{zyx2R.html => eulerZYXToRotationMatrix.html} (51%) create mode 100644 functions/fromECEF.html create mode 100644 functions/fromGeodeticCoordinates.html create mode 100644 functions/fromRotationMatrix.html delete mode 100644 functions/lat_long2n_E.html delete mode 100644 functions/n_E2R_EN.html delete mode 100644 functions/n_E2lat_long.html delete mode 100644 functions/n_EA_E_and_n_EB_E2p_AB_E.html delete mode 100644 functions/n_EA_E_and_p_AB_E2n_EB_E.html delete mode 100644 functions/n_EB_E2p_EB_E.html delete mode 100644 functions/n_E_and_wa2R_EL.html create mode 100644 functions/normalize.html delete mode 100644 functions/p_EB_E2n_EB_E.html delete mode 100644 functions/rad.html create mode 100644 functions/radians.html delete mode 100644 functions/rotate.html create mode 100644 functions/rotationMatrixToEulerXYZ.html create mode 100644 functions/rotationMatrixToEulerZYX.html create mode 100644 functions/sphere.html create mode 100644 functions/toECEF.html create mode 100644 functions/toGeodeticCoordinates.html create mode 100644 functions/toRotationMatrix.html create mode 100644 functions/toRotationMatrixUsingWanderAzimuth.html create mode 100644 functions/transform.html delete mode 100644 functions/unit.html rename types/{Matrix3x3.html => Matrix.html} (56%) rename types/{Vector3.html => Vector.html} (54%) delete mode 100644 variables/R_Ee_NP_X.html delete mode 100644 variables/R_Ee_NP_Z.html delete mode 100644 variables/WGS_84_SPHERE.html create mode 100644 variables/X_AXIS_NORTH.html create mode 100644 variables/Z_AXIS_NORTH.html diff --git a/assets/navigation.js b/assets/navigation.js index 9579c8b..e21cc4c 100644 --- a/assets/navigation.js +++ b/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA43T0U7CMBQG4HfpNREsKMgdJA1eICEjUaMxTWUTFrt2aYtuM767YWODydkZt/3P9687y15/iAsSR8aESRnGVoc+6ZBYuC0ZE5fGge1WwdXWRZJ0yGeofDKmvbvh9Q397VQND8KZMOkn/f8NVdDW8BisnTZn/nDcpmfeio96R/wlTCjeZWC7RVL3/VPqcRbwxZI/Q7oKLyh4wQpekIKn2YoPKaSLpIWOBk10NGilfLW8Zx5rbjgMYO9PkzQ7Fnzs1NqFWtluHtTh7aAGszSBYZYmGORsThVnoD1kOF8gfNHCRRzLFLJ5gMC10dZCMA8Q6AcbiPnBBkPagUg7BEnhuNRq07Se0xypiXbShQ1bKjOEK87o/kNAvMxaeHnRpooyx2smnHGhfK44m3JGYz6Zwntpmr2svpilhWypr83i9cU1kM7jAF6UP/hb7Pc+b6g6HcHKtInABm0ihBWXRBZUG0CKjPAhboSPIe2EC0CXJwh1RigbawvqKkQKdioEf+P9OcKSNKMe5PIAgVmawDAPzuDbH0xQK7dFCAAA" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA5WTXU/CMBSG/0uviSCiIHeETPRCTQBlzJilssIau3ZpDwYw/ncDg/HVnY7bvu/zNDs7/fglwBZA2sQTgqdG8YhUSEohJm0Cy5SZah5cxZAIUiHfXEakXa/dN69v63+V3PBMQfPFKZ6duth3NgGlT9ns1MX2+oOwVduzP1Rz+iWYqWbJMX9ziI56g7BZt6FZ4kBbjSK01UBQP+z4T4Pw5bU/fLQJDnNEEzg0QTkNTVOx3PPTuZwAV9JUN8ExeNc4ACdaGWMDNwECRmymGbOi2wiFBVA7KoCioAEu6bpsx/MYkyiwwgoQiM0F0/44GKq+gs0Np09lbyrquvTB2C+tt3QR/VSrxOt6DzbdLnPgPaYiBnzSVUpH6yHbf35B1SF3f/R5C1EmcwG84EXsMgSXSic2dH3uwKjgK1bEbkJEoGnEqbSOdRth8NFwhsrbLqHVVtC9VB+M/dL6YOwjepPGTFsHlyUICqpos7MERUtutbWIit0bfdq5QPdmuJyNqIyY7qx4Moe4zAXnFHalptJMCx5CHroEqTLWn5qHZ4LPfy13A/HOCAAA" \ No newline at end of file diff --git a/assets/search.js b/assets/search.js index 9a6e405..2a9d03e 100644 --- a/assets/search.js +++ b/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA52Y3W7jNhCF34W9FRxz6P+7XcDYFtgGiwRoixUMQomZrFCZEiglsWPk3QtKtjTjHbrSXoqcc0jOx6FEHYXL30qxio/i39RuxWo2iYRNdkasxB3sD+8iEi8uEyvx9GIfqzS35U3dPvpR7TIRiccsKUtTipUQHxFr8n7Ysybvh31vE73+ClavOZ9T1wCr27DV7RCrrXlmXLbm+aqBgtbgy929Xoxbj9fEpclDZsqbpqOvzd9f7vUcGJumY4jNYhKwWUyG2ej7b7+v79ZBt1P/VVMYL+dy2jmvsywtyjzdtq7VoTDlTdt+Hdx0qmatl9Zee9XotzYG+UWiSJyxFZlON4gcQ7c/kj72o+T/BxidZhIY56nXOE+/Mg7a7VlS6Sy3z4Hiwd19C2j3klVpkR0Yu3NXX6vKJbYs8tIwXm3foN32Z1K5dK/26iK7bXvfqVm9Bn+0MDM7dw2xOic6YHfuHmD5Sa91Yrfa6vVnvYZCf/rMIg6F/sJQjRAam+tDkdABQzXzC/t3/QNM6xm9JR7aV94WR/Q1bqYRzgbp72vqki1j5ZLrpyQ6yO/02ujbb/of5hBv+4aafb9i9r330vIqqbhKbzr62rzYtGJMfHNfi6Tgj6+6va/Jo8vLkjGp23t/jOTcWrZ576XY3O24LZ273aBz8y/zWOXu8tQ8tfadzP7wDnfMbOr2vibvhz1rUrdzJptIpHZr9mJ1FK/GlWluxUrASI2WIhJPqcm2/lO58Y/EY77b+Tfo5tTXrNFHNCE3YxHF40jBaDydbjZRfFbUHXVDHSZFFEsuTJIwEFEMXBiQMCWiWHFhioRNRBRPuLAJCZuKKJ5yYVMSNhNRPOPCZiRsLqJ4zoXNSdhCRPGCC1uQsKWI4iUXtqTp9dmWLAd5AaImwaOgLKTPuWRpSIpD+rRLFoikRKTPvGSZSApF+uRLFoukXKTPv2TJSIpGegSShSMpHekpSJaPpICkByFZRJIyAg8CWEZAGYEHASwjuKiXumD4iqGMwIMAlhFQRuBBAMsIKCPwIIBlBJQReBDAMgLKCDwIYBkBZQQeBLCMgDICDwJYRkAZKQ9CsYwUZaQ8CMUyUpSR8iAUy0hdHGv1ucYfbJSR8iAUy0hRRsqDUCwj1TCq3wivxlVm+0fzZojj9u54FPr0upDj80vnKORYrI4fH93rwT9564QoJFLIkKL5uuhUsOxUsAyoTp8TnUqh2anQ7OqfGZ1m0kkmIYX/4kCjoBWp0IpMd4XvlGhRoTU9kdwByh0EFM+urP+tdLJpp5oGROgSS/kqNKIKiHfdhREpZ0g5CynbezASIgIyhMBqg+6DSLxA4sUVsdPGEuEcCedh4fmW47TJyAZFaCCExmqTnCysNg/aQKGTh4uMo00hQ7sCGTUO0PiRGaHND6HN307jJzXa1BDa1M2XM6oElAQVSkIzFjdhtNcgtNdc82u2U6FVhhbpmj+xKMcoxSGNNkbbQhMdoEqCUCmdlWSWgKoBQtXg99RlAeJtFZbZSxlKZTCTCTmLAJUdhMrufP9EMlQ3EKob9I8KQUDJlKFkNjdVNByqbwjV9+v5IobygRMSysjbc1n/Tu5kiFoImhf5n8edCGUklJBGpMvih3EkKWh5odX5m6Aja0PkVIicv/pRFUq/YtO/iUSRFiZLrRGrePPx8R8/if1zMxkAAA=="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WYb2/iOBDGv4vvbUTxmP/vVqteb1/cndT2bikRQikxbXQhRolpKYjvfnISkjE7pmb3JXieZ+L5jRPbB5ar94JNwgP7L8liNhn0ApZFa8kmLJYvuZQFC9g2T9mErbbZUicqK27qkc6rXqcsYMs0KgpZsAljx4AwyqM4iTLKqB65aCSgMZouvky/PSz++vv+8Y/G7S3Kk+g5lcUNHva1nF22nPlaoumucrW+kyqWOll+VSqPkyzSZB0dkb6JtPJLQ8b5JollqiOyB1Id+ZsU2qRNVEZaNaPX1Pj26+3vjqKaIf8qOoyqAd9Gurt/WIy6RAtVA7423+8eFkMgbKqBa2xGPYfNqOdbm2LzKnNJ1KYauGgD3fGQ99tHuk3TZFOoJG7s9MdGFjfN/5cfqt8Xg8ZrsTDai0a/NTHIL2CbKJeZth6nTcK70M498rHvRJ8n6NRP4sjz7JXn+ZfzrLzyrH4mD+oYuU1lPn2aPap7pcsl/Wek82RH9JAr1Lc5S/3saeqbigj1/oJZqkd1Wz869UlzhP5SqtnT1DfV7Gnqm2q9TXWyST8I69OQ90s0j7JiowrqXdGMXfW6OGNZ9ex11MyX4NPW+DHI/8Pxqfl5yM9a/1Mk2cv3KItl/mWfrLf61SPZjyLf9NGG7oryf1+TZa4KajdS/u+9cVCa2jAo7WuQqXxNOJi/r7GI0mRP9XYzdtVCWdEP1YxdtVD+lUut8rOFUv1J+cwDlmSx3LHJgb3JvDBbsgmDjuiMWcBWiUxjcx6o3AO2VOu1ef/P67HK2ERUITddFoTdQECn2+/P50F4UpQD5R9lGGdByKkwboUBC0KgwsAKEywIBRUmrLAeC8IeFdazwvosCPtUWN8KG7AgHFBhAytsyIJwSIUNrbARC8IRFTaywsYsCMdU2Ngur6k2JznwMxAlCRqFzYKbmnOSBrdxcFN2TgLhNhFuKs9JJtyGwk3xOYmF21y4qT8nyXAbDTcIOAmH23S4ocBJPtwGxA0ITiLiNiMwIIBkBDYjMCCAZARn66VcMPSKsRmBAQEkI7AZgQEBJCOwGYEBASQjsBmBAQEkI7AZgQEBJCOwGYEBASQjsBmBAQEkI7AZCQNCkIyEzUgYEIJkJGxGwoAQJCNx9lor32v0i81mJAwIQTISNiNhQAiSkagYlV+EN5lrGX+rvgxh2JywDmxRfy54//TJOTDeZ5PD8dh+HswvYx1ZigFSDFyKaq/RqmDcqmDsUD1beYYoz9ChqLcjrUp0W5XoOlTNHVirQzK3qrwzaTWoEK46WFckrRJNzTWzco+E5sXRvLhDI9vDOKpjD9Wx51KaQ8buY6/V6fixrne/yAgh5C6EpdH+Y3fJCFCxwVXtlZV6hFKPXIpcreVSWkKkuyR7qW/SlvjGrXVBFXQV0LhcmDFqFXD1yktelHdNaNqoUNxVKCIbWtPgWtPtMREJBRIKh7Dae6POBNSZcEFU77aREqUTrnTNNTMqC6qKS2Wh0OrU39ZskQ9cZbT/sOuNKgCuCpwu3dA00PS5a/panbc0WoWuRajVJw2NGsTVHxcXMHp/gesFdm6wNQfX9/LgGp1Ou8gSrVRwLVV0zEJdhFancC1PdJOBciIluJRv9UEMJUTVE67yvb8U5Y0vwo3b1tVuRmZueJEMNRd3NdduEe2SYpGp/KyqaIIO6d4hxWuTks4Dtkk2Mk0yySbh/Hj8HwndFpx1GgAA"; \ No newline at end of file diff --git a/functions/R2xyz.html b/functions/R2xyz.html deleted file mode 100644 index 5ba7f71..0000000 --- a/functions/R2xyz.html +++ /dev/null @@ -1,18 +0,0 @@ -R2xyz | nvector-geodesy

Function R2xyz

  • 3 angles about new axes in the xyz order are found from a rotation matrix.

    -

    3 angles x,y,z about new axes (intrinsic) in the order x-y-z 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 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.

    -

    Parameters

    • R_AB: Matrix3x3

      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.

      -

    Returns Vector3

    Angles of rotation about new axes.

    -
\ No newline at end of file diff --git a/functions/R2zyx.html b/functions/R2zyx.html deleted file mode 100644 index f7b7a6b..0000000 --- a/functions/R2zyx.html +++ /dev/null @@ -1,20 +0,0 @@ -R2zyx | nvector-geodesy

Function R2zyx

  • 3 angles about new axes in the zyx order are found from a rotation matrix.

    -

    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.

    -

    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.

    -

    Parameters

    • R_AB: Matrix3x3

      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.

      -

    Returns Vector3

    Angles of rotation about new axes.

    -
\ No newline at end of file diff --git a/functions/R_EL2n_E.html b/functions/R_EL2n_E.html deleted file mode 100644 index f475f36..0000000 --- a/functions/R_EL2n_E.html +++ /dev/null @@ -1,5 +0,0 @@ -R_EL2n_E | nvector-geodesy

Function R_EL2n_E

\ No newline at end of file diff --git a/functions/R_EN2n_E.html b/functions/R_EN2n_E.html deleted file mode 100644 index 4181d79..0000000 --- a/functions/R_EN2n_E.html +++ /dev/null @@ -1,5 +0,0 @@ -R_EN2n_E | nvector-geodesy

Function R_EN2n_E

\ No newline at end of file diff --git a/functions/apply.html b/functions/apply.html index eebc0e3..4f3bcce 100644 --- a/functions/apply.html +++ b/functions/apply.html @@ -1,12 +1,12 @@ -apply | nvector-geodesy

Function apply

  • Creates a new vector by applying a function component-wise to the components +apply | nvector-geodesy

    Function apply

    • Creates a new vector by applying a function component-wise to the components of one or more input vectors.

      Type Parameters

      • N extends number[]

      Parameters

      • fn: ((...n) => number)

        The function to apply to each component.

        -
          • (...n): number
          • Parameters

            • Rest ...n: N

            Returns number

      • Rest ...v: {
            [Property in string | number | symbol]: Vector3
        }

        The vectors.

        -

      Returns Vector3

      The resulting vector.

      +
      • (...n): number
      • Parameters

        • Rest ...n: N

        Returns number

  • Rest ...v: {
        [Property in string | number | symbol]: Vector
    }

    The vectors.

    +

Returns Vector

The resulting vector.

Example: Find the sum of two vectors

apply((a, b) => a + b, [1, 2, 3], [4, 5, 6]); // [5, 7, 9]
 

Example: Scale a vector by a scalar

apply((i) => i * 2, [1, 2, 3]); // [2, 4, 6]
 

Example: Interpolate between two vectors

apply((a, b) => a + (b - a) / 2, [1, 2, 3], [4, 5, 6]); // [2.5, 3.5, 4.5]
 
-
\ No newline at end of file +
\ No newline at end of file diff --git a/functions/cross.html b/functions/cross.html index 7b7efaa..ac76b34 100644 --- a/functions/cross.html +++ b/functions/cross.html @@ -1,5 +1,5 @@ -cross | nvector-geodesy

Function cross

\ No newline at end of file +cross | nvector-geodesy

Function cross

  • Finds the cross product of two vectors.

    +

    Parameters

    Returns Vector

    The resulting vector.

    +
\ No newline at end of file diff --git a/functions/deg.html b/functions/deg.html deleted file mode 100644 index a251aec..0000000 --- a/functions/deg.html +++ /dev/null @@ -1,5 +0,0 @@ -deg | nvector-geodesy

Function deg

\ No newline at end of file diff --git a/functions/degrees.html b/functions/degrees.html new file mode 100644 index 0000000..a9c6a7c --- /dev/null +++ b/functions/degrees.html @@ -0,0 +1,5 @@ +degrees | nvector-geodesy

Function degrees

\ No newline at end of file diff --git a/functions/xyz2R.html b/functions/delta.html similarity index 62% rename from functions/xyz2R.html rename to functions/delta.html index 9eb6fe9..d97f27c 100644 --- a/functions/xyz2R.html +++ b/functions/delta.html @@ -1,19 +1,11 @@ -xyz2R | nvector-geodesy

Function xyz2R

  • Creates a rotation matrix from 3 angles about new axes in the xyz order.

    -

    The rotation matrix R_AB is created based on 3 angles x,y,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, 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.

    -

    Parameters

    • x: number

      Angle of rotation about the new x-axis in radians.

      -
    • y: number

      Angle of rotation about the new y-axis in radians.

      -
    • z: number

      Angle of rotation about the new z-axis in radians.

      -

    Returns Matrix3x3

    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.

    -
\ No newline at end of file +delta | nvector-geodesy

Function delta

\ No newline at end of file diff --git a/functions/destination.html b/functions/destination.html new file mode 100644 index 0000000..e685228 --- /dev/null +++ b/functions/destination.html @@ -0,0 +1,10 @@ +destination | nvector-geodesy

Function destination

\ No newline at end of file diff --git a/functions/dot.html b/functions/dot.html index a7b92dc..d1d243b 100644 --- a/functions/dot.html +++ b/functions/dot.html @@ -1,5 +1,5 @@ dot | nvector-geodesy

Function dot

  • Finds the dot product of two vectors.

    -

    Parameters

\ No newline at end of file +
\ No newline at end of file diff --git a/functions/eulerXYZToRotationMatrix.html b/functions/eulerXYZToRotationMatrix.html new file mode 100644 index 0000000..823163d --- /dev/null +++ b/functions/eulerXYZToRotationMatrix.html @@ -0,0 +1,7 @@ +eulerXYZToRotationMatrix | nvector-geodesy

Function eulerXYZToRotationMatrix

\ No newline at end of file diff --git a/functions/zyx2R.html b/functions/eulerZYXToRotationMatrix.html similarity index 51% rename from functions/zyx2R.html rename to functions/eulerZYXToRotationMatrix.html index f00954f..d91b3af 100644 --- a/functions/zyx2R.html +++ b/functions/eulerZYXToRotationMatrix.html @@ -1,20 +1,7 @@ -zyx2R | nvector-geodesy

Function zyx2R

  • Creates a rotation matrix from 3 angles about new axes in the zyx order.

    -

    The rotation matrix R_AB is created based on 3 angles z,y,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.

    -

    Parameters

    • z: number

      Angle of rotation about the new z-axis in radians.

      -
    • y: number

      Angle of rotation about the new y-axis in radians.

      -
    • x: number

      Angle of rotation about the new x-axis in radians.

      -

    Returns Matrix3x3

    The rotation matrix.

    +eulerZYXToRotationMatrix | nvector-geodesy

    Function eulerZYXToRotationMatrix

    \ No newline at end of file +
\ No newline at end of file diff --git a/functions/fromECEF.html b/functions/fromECEF.html new file mode 100644 index 0000000..e911cfc --- /dev/null +++ b/functions/fromECEF.html @@ -0,0 +1,8 @@ +fromECEF | nvector-geodesy

Function fromECEF

\ No newline at end of file diff --git a/functions/fromGeodeticCoordinates.html b/functions/fromGeodeticCoordinates.html new file mode 100644 index 0000000..437d762 --- /dev/null +++ b/functions/fromGeodeticCoordinates.html @@ -0,0 +1,7 @@ +fromGeodeticCoordinates | nvector-geodesy

Function fromGeodeticCoordinates

\ No newline at end of file diff --git a/functions/fromRotationMatrix.html b/functions/fromRotationMatrix.html new file mode 100644 index 0000000..27677e0 --- /dev/null +++ b/functions/fromRotationMatrix.html @@ -0,0 +1,8 @@ +fromRotationMatrix | nvector-geodesy

Function fromRotationMatrix

\ No newline at end of file diff --git a/functions/lat_long2n_E.html b/functions/lat_long2n_E.html deleted file mode 100644 index 1f9a034..0000000 --- a/functions/lat_long2n_E.html +++ /dev/null @@ -1,7 +0,0 @@ -lat_long2n_E | nvector-geodesy

Function lat_long2n_E

\ No newline at end of file diff --git a/functions/multiply.html b/functions/multiply.html index c5ef4b7..d44d016 100644 --- a/functions/multiply.html +++ b/functions/multiply.html @@ -1,5 +1,5 @@ -multiply | nvector-geodesy

Function multiply

\ No newline at end of file +multiply | nvector-geodesy

Function multiply

\ No newline at end of file diff --git a/functions/n_E2R_EN.html b/functions/n_E2R_EN.html deleted file mode 100644 index de8af32..0000000 --- a/functions/n_E2R_EN.html +++ /dev/null @@ -1,6 +0,0 @@ -n_E2R_EN | nvector-geodesy

Function n_E2R_EN

\ No newline at end of file diff --git a/functions/n_E2lat_long.html b/functions/n_E2lat_long.html deleted file mode 100644 index c93d143..0000000 --- a/functions/n_E2lat_long.html +++ /dev/null @@ -1,6 +0,0 @@ -n_E2lat_long | nvector-geodesy

Function n_E2lat_long

\ No newline at end of file diff --git a/functions/n_EA_E_and_n_EB_E2p_AB_E.html b/functions/n_EA_E_and_n_EB_E2p_AB_E.html deleted file mode 100644 index d452220..0000000 --- a/functions/n_EA_E_and_n_EB_E2p_AB_E.html +++ /dev/null @@ -1,17 +0,0 @@ -n_EA_E_and_n_EB_E2p_AB_E | nvector-geodesy

Function n_EA_E_and_n_EB_E2p_AB_E

  • From two positions A and B, finds the delta position.

    -

    The calculation is exact, taking the ellipsity 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.

    -

    Parameters

    • n_EA_E: Vector3

      An n-vector of position A, decomposed in E.

      -
    • n_EB_E: Vector3

      An n-vector of position B, decomposed in E.

      -
    • z_EA: number = 0

      Depth of system A in meters, relative to the ellipsoid (z_EA = - -height).

      -
    • z_EB: number = 0

      Depth of system B in meters, relative to the ellipsoid (z_EB = - -height).

      -
    • a: number = WGS_84.a

      Semi-major axis of the Earth ellipsoid in meters.

      -
    • f: number = WGS_84.f

      Flattening of the Earth ellipsoid.

      -
    • R_Ee: Matrix3x3 = R_Ee_NP_Z

      Defines the axes of the coordinate frame E.

      -

    Returns Vector3

    Position vector in meters from A to B, decomposed in E.

    -
\ No newline at end of file diff --git a/functions/n_EA_E_and_p_AB_E2n_EB_E.html b/functions/n_EA_E_and_p_AB_E2n_EB_E.html deleted file mode 100644 index 34e3b90..0000000 --- a/functions/n_EA_E_and_p_AB_E2n_EB_E.html +++ /dev/null @@ -1,16 +0,0 @@ -n_EA_E_and_p_AB_E2n_EB_E | nvector-geodesy

Function n_EA_E_and_p_AB_E2n_EB_E

  • From position A and delta, finds position B.

    -

    The calculation is exact, taking the ellipsity 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.

    -

    Parameters

    • n_EA_E: Vector3

      An n-vector of position A, decomposed in E.

      -
    • p_AB_E: Vector3

      Position vector in meters from A to B, decomposed in E.

      -
    • z_EA: number = 0

      Depth of system A in meters, relative to the ellipsoid (z_EA = - -height).

      -
    • a: number = WGS_84.a

      Semi-major axis of the Earth ellipsoid in meters.

      -
    • f: number = WGS_84.f

      Flattening of the Earth ellipsoid.

      -
    • R_Ee: Matrix3x3 = R_Ee_NP_Z

      Defines the axes of the coordinate frame E.

      -

    Returns [n_EB_E: Vector3, z_EB: number]

    An n-vector of position B, decomposed in E, and depth in meters of - system B, relative to the ellipsoid (-height).

    -
\ No newline at end of file diff --git a/functions/n_EB_E2p_EB_E.html b/functions/n_EB_E2p_EB_E.html deleted file mode 100644 index 017ae6c..0000000 --- a/functions/n_EB_E2p_EB_E.html +++ /dev/null @@ -1,17 +0,0 @@ -n_EB_E2p_EB_E | nvector-geodesy

Function n_EB_E2p_EB_E

  • Converts n-vector to Cartesian position vector in meters.

    -

    The position of B (typically body) relative to E (typically Earth) is given -into this function as n-vector, n_EB_E. The function converts to cartesian -position vector ("ECEF-vector"), p_EB_E, in meters.

    -

    The calculation is exact, taking the ellipsity 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.

    -

    Parameters

    • n_EB_E: Vector3

      An n-vector of position B, decomposed in E.

      -
    • z_EB: number = 0

      Depth of system B in meters, relative to the ellipsoid (z_EB = - -height).

      -
    • a: number = WGS_84.a

      Semi-major axis of the Earth ellipsoid in meters.

      -
    • f: number = WGS_84.f

      Flattening of the Earth ellipsoid.

      -
    • R_Ee: Matrix3x3 = R_Ee_NP_Z

      Defines the axes of the coordinate frame E.

      -

    Returns Vector3

    Cartesian position vector in meters from E to B, decomposed in E.

    -
\ No newline at end of file diff --git a/functions/n_E_and_wa2R_EL.html b/functions/n_E_and_wa2R_EL.html deleted file mode 100644 index 252bd42..0000000 --- a/functions/n_E_and_wa2R_EL.html +++ /dev/null @@ -1,10 +0,0 @@ -n_E_and_wa2R_EL | nvector-geodesy

Function n_E_and_wa2R_EL

\ No newline at end of file diff --git a/functions/norm.html b/functions/norm.html index 5036347..68b728b 100644 --- a/functions/norm.html +++ b/functions/norm.html @@ -1,4 +1,4 @@ norm | nvector-geodesy

Function norm

  • Finds the Euclidean norm of a vector.

    -

    Parameters

\ No newline at end of file +
\ No newline at end of file diff --git a/functions/normalize.html b/functions/normalize.html new file mode 100644 index 0000000..5bd1848 --- /dev/null +++ b/functions/normalize.html @@ -0,0 +1,5 @@ +normalize | nvector-geodesy

Function normalize

\ No newline at end of file diff --git a/functions/p_EB_E2n_EB_E.html b/functions/p_EB_E2n_EB_E.html deleted file mode 100644 index 099d9ab..0000000 --- a/functions/p_EB_E2n_EB_E.html +++ /dev/null @@ -1,18 +0,0 @@ -p_EB_E2n_EB_E | nvector-geodesy

Function p_EB_E2n_EB_E

  • Converts Cartesian position vector in meters to n-vector.

    -

    The position of B (typically body) relative to E (typically Earth) is given -into this function as cartesian position vector p_EB_E, in meters -("ECEF-vector"). The function converts to n-vector, n_EB_E and its depth, -z_EB.

    -

    The calculation is exact, taking the ellipsity 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.

    -

    Parameters

    • p_EB_E: Vector3

      Cartesian position vector in meters from E to B, decomposed - in E.

      -
    • a: number = WGS_84.a

      Semi-major axis of the Earth ellipsoid in meters.

      -
    • f: number = WGS_84.f

      Flattening of the Earth ellipsoid.

      -
    • R_Ee: Matrix3x3 = R_Ee_NP_Z

      Defines the axes of the coordinate frame E.

      -

    Returns [n_EB_E: Vector3, depth: number]

    Representation of position B, decomposed in E, and depth in meters - of system B relative to the ellipsoid.

    -
\ No newline at end of file diff --git a/functions/rad.html b/functions/rad.html deleted file mode 100644 index 92a3593..0000000 --- a/functions/rad.html +++ /dev/null @@ -1,5 +0,0 @@ -rad | nvector-geodesy

Function rad

\ No newline at end of file diff --git a/functions/radians.html b/functions/radians.html new file mode 100644 index 0000000..5e08604 --- /dev/null +++ b/functions/radians.html @@ -0,0 +1,5 @@ +radians | nvector-geodesy

Function radians

\ No newline at end of file diff --git a/functions/rotate.html b/functions/rotate.html deleted file mode 100644 index 9d47546..0000000 --- a/functions/rotate.html +++ /dev/null @@ -1,5 +0,0 @@ -rotate | nvector-geodesy

Function rotate

\ No newline at end of file diff --git a/functions/rotationMatrixToEulerXYZ.html b/functions/rotationMatrixToEulerXYZ.html new file mode 100644 index 0000000..9d4477f --- /dev/null +++ b/functions/rotationMatrixToEulerXYZ.html @@ -0,0 +1,5 @@ +rotationMatrixToEulerXYZ | nvector-geodesy

Function rotationMatrixToEulerXYZ

\ No newline at end of file diff --git a/functions/rotationMatrixToEulerZYX.html b/functions/rotationMatrixToEulerZYX.html new file mode 100644 index 0000000..fbafed4 --- /dev/null +++ b/functions/rotationMatrixToEulerZYX.html @@ -0,0 +1,5 @@ +rotationMatrixToEulerZYX | nvector-geodesy

Function rotationMatrixToEulerZYX

\ No newline at end of file diff --git a/functions/sphere.html b/functions/sphere.html new file mode 100644 index 0000000..1bae50d --- /dev/null +++ b/functions/sphere.html @@ -0,0 +1,4 @@ +sphere | nvector-geodesy

Function sphere

  • Create a spherical ellipsoid with the given radius.

    +

    Parameters

    • radius: number

      A radius in meters.

      +

    Returns Ellipsoid

    A spherical ellipsoid.

    +
\ No newline at end of file diff --git a/functions/toECEF.html b/functions/toECEF.html new file mode 100644 index 0000000..fcea748 --- /dev/null +++ b/functions/toECEF.html @@ -0,0 +1,8 @@ +toECEF | nvector-geodesy

Function toECEF

\ No newline at end of file diff --git a/functions/toGeodeticCoordinates.html b/functions/toGeodeticCoordinates.html new file mode 100644 index 0000000..a55d610 --- /dev/null +++ b/functions/toGeodeticCoordinates.html @@ -0,0 +1,6 @@ +toGeodeticCoordinates | nvector-geodesy

Function toGeodeticCoordinates

\ No newline at end of file diff --git a/functions/toRotationMatrix.html b/functions/toRotationMatrix.html new file mode 100644 index 0000000..7364b18 --- /dev/null +++ b/functions/toRotationMatrix.html @@ -0,0 +1,6 @@ +toRotationMatrix | nvector-geodesy

Function toRotationMatrix

\ No newline at end of file diff --git a/functions/toRotationMatrixUsingWanderAzimuth.html b/functions/toRotationMatrixUsingWanderAzimuth.html new file mode 100644 index 0000000..0be1425 --- /dev/null +++ b/functions/toRotationMatrixUsingWanderAzimuth.html @@ -0,0 +1,7 @@ +toRotationMatrixUsingWanderAzimuth | nvector-geodesy

Function toRotationMatrixUsingWanderAzimuth

\ No newline at end of file diff --git a/functions/transform.html b/functions/transform.html new file mode 100644 index 0000000..1ede2ff --- /dev/null +++ b/functions/transform.html @@ -0,0 +1,5 @@ +transform | nvector-geodesy

Function transform

  • Transforms a vector by a matrix.

    +

    Parameters

    Returns Vector

    The transformed vector.

    +
\ No newline at end of file diff --git a/functions/transpose.html b/functions/transpose.html index a68c9e5..76c4cbb 100644 --- a/functions/transpose.html +++ b/functions/transpose.html @@ -1,4 +1,4 @@ -transpose | nvector-geodesy

Function transpose

\ No newline at end of file +transpose | nvector-geodesy

Function transpose

\ No newline at end of file diff --git a/functions/unit.html b/functions/unit.html deleted file mode 100644 index e2f2cc9..0000000 --- a/functions/unit.html +++ /dev/null @@ -1,5 +0,0 @@ -unit | nvector-geodesy

Function unit

\ No newline at end of file diff --git a/index.html b/index.html index 6013c00..127be9c 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,11 @@ Build status Test coverage

This library is a lightweight (<2kB), dependency-free port of the Matlab -n-vector library by Kenneth Gade. All original functions are included, plus -some extras for vector and matrix operations needed to solve the 10 examples -from the n-vector page.

+n-vector library by Kenneth Gade. All original functions are included, +although the names of the functions and arguments have been changed in an +attempt to clarify their purpose. In addition, this library includes some extra +functions for vector and matrix operations needed to solve the 10 examples from +the n-vector page.

See the reference documentation for a list of all functions and their signatures.

Installation

npm install nvector-geodesy
@@ -19,7 +21,7 @@
 relative to north. Use WGS-84 ellipsoid.

https://www.ffi.no/en/research/n-vector/#example_1

-
import {
lat_long2n_E,
n_E2R_EN,
n_EA_E_and_n_EB_E2p_AB_E,
rad,
rotate,
transpose,
} from "nvector-geodesy";

// Positions A and B are given in (decimal) degrees and depths:

// Position A:
const lat_EA_deg = 1;
const long_EA_deg = 2;
const z_EA = 3;

// Position B:
const lat_EB_deg = 4;
const long_EB_deg = 5;
const z_EB = 6;

// Find the exact vector between the two positions, given in meters north,
// east, and down, i.e. find p_AB_N.

// SOLUTION:

// Step1: Convert to n-vectors (rad() converts to radians):
const n_EA_E = lat_long2n_E(rad(lat_EA_deg), rad(long_EA_deg));
const n_EB_E = lat_long2n_E(rad(lat_EB_deg), rad(long_EB_deg));

// Step2: Find p_AB_E (delta decomposed in E). WGS-84 ellipsoid is default:
const p_AB_E = n_EA_E_and_n_EB_E2p_AB_E(n_EA_E, n_EB_E, z_EA, z_EB);

// Step3: Find R_EN for position A:
const R_EN = n_E2R_EN(n_EA_E);

// Step4: Find p_AB_N
const p_AB_N = rotate(transpose(R_EN), p_AB_E);
// (Note the transpose of R_EN: The "closest-rule" says that when decomposing,
// the frame in the subscript of the rotation matrix that is closest to the
// vector, should equal the frame where the vector is decomposed. Thus the
// calculation R_NE*p_AB_E is correct, since the vector is decomposed in E,
// and E is closest to the vector. In the above example we only had R_EN, and
// thus we must transpose it: R_EN' = R_NE)

// Step5: Also find the direction (azimuth) to B, relative to north:
const azimuth = Math.atan2(p_AB_N[1], p_AB_N[0]); +
import {
delta,
fromGeodeticCoordinates,
radians,
toRotationMatrix,
transform,
transpose,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 1: A and B to delta
*
* Given two positions A and B. Find the exact vector from A to B in meters
* north, east and down, and find the direction (azimuth/bearing) to B, relative
* to north. Use WGS-84 ellipsoid.
*
* @see https://www.ffi.no/en/research/n-vector/#example_1
*/
test("Example 1", () => {
// PROBLEM:

// Given two positions, A and B as latitudes, longitudes and depths (relative
// to Earth, E):
const aLat = 1,
aLon = 2,
aDepth = 3;
const bLat = 4,
bLon = 5,
bDepth = 6;

// Find the exact vector between the two positions, given in meters north,
// east, and down, and find the direction (azimuth) to B, relative to north.
//
// Details:
//
// - Assume WGS-84 ellipsoid. The given depths are from the ellipsoid surface.
// - Use position A to define north, east, and down directions. (Due to the
// curvature of Earth and different directions to the North Pole, the north,
// east, and down directions will change (relative to Earth) for different
// places. Position A must be outside the poles for the north and east
// directions to be defined.

// SOLUTION:

// Step 1
//
// First, the given latitudes and longitudes are converted to n-vectors:
const a = fromGeodeticCoordinates(radians(aLat), radians(aLon));
const b = fromGeodeticCoordinates(radians(bLat), radians(bLon));

// Step 2
//
// When the positions are given as n-vectors (and depths), it is easy to find
// the delta vector decomposed in E. No ellipsoid is specified when calling
// the function, thus WGS-84 (default) is used:
const abE = delta(a, b, aDepth, bDepth);

// Step 3
//
// We now have the delta vector from A to B, but the three coordinates of the
// vector are along the Earth coordinate frame E, while we need the
// coordinates to be north, east and down. To get this, we define a
// North-East-Down coordinate frame called N, and then we need the rotation
// matrix (direction cosine matrix) rEN to go between E and N. We have a
// simple function that calculates rEN from an n-vector, and we use this
// function (using the n-vector at position A):
const rEN = toRotationMatrix(a);

// Step 4
//
// Now the delta vector is easily decomposed in N. Since the vector is
// decomposed in E, we must use rNE (rNE is the transpose of rEN):
const abN = transform(transpose(rEN), abE);

// Step 5
//
// The three components of abN are the north, east and down displacements from
// A to B in meters. The azimuth is simply found from element 1 and 2 of the
// vector (the north and east components):
const azimuth = Math.atan2(abN[1], abN[0]);

expect(abN[0]).toBeCloseTo(331730.2347808944, 8);
expect(abN[1]).toBeCloseTo(332997.8749892695, 8);
expect(abN[2]).toBeCloseTo(17404.27136193635, 8);
expect(azimuth).toBeCloseTo(radians(45.10926323826139), 15);
});

Example 2: B and delta to C

Illustration of example 2

@@ -27,7 +29,7 @@ Find the exact position of C. Use WGS-72 ellipsoid.

https://www.ffi.no/en/research/n-vector/#example_2

-
import {
WGS_72,
deg,
multiply,
n_E2R_EN,
n_E2lat_long,
n_EA_E_and_p_AB_E2n_EB_E,
rad,
rotate,
unit,
zyx2R,
type Vector3,
} from "nvector-geodesy";

// delta vector from B to C, decomposed in B is given:
const p_BC_B: Vector3 = [3000, 2000, 100];

// Position and orientation of B is given:
// unit to get unit length of vector
const n_EB_E = unit([1, 2, 3]);
const z_EB = -400;
// the three angles are yaw, pitch, and roll
const R_NB = zyx2R(rad(10), rad(20), rad(30));

// A custom reference ellipsoid is given (replacing WGS-84):
// (WGS-72)
const a = WGS_72.a;
const f = WGS_72.f;

// Find the position of C.

// SOLUTION:

// Step1: Find R_EN:
const R_EN = n_E2R_EN(n_EB_E);

// Step2: Find R_EB, from R_EN and R_NB:
// Note: closest frames cancel
const R_EB = multiply(R_EN, R_NB);

// Step3: Decompose the delta vector in E:
// no transpose of R_EB, since the vector is in B
const p_BC_E = rotate(R_EB, p_BC_B);

// Step4: Find the position of C, using the functions that goes from one
// position and a delta, to a new position:
const [n_EC_E, z_EC] = n_EA_E_and_p_AB_E2n_EB_E(n_EB_E, p_BC_E, z_EB, a, f);

// When displaying the resulting position for humans, it is more convenient
// to see lat, long:
const [lat_EC, long_EC] = n_E2lat_long(n_EC_E);

// Here we also assume that the user wants the output to be height (= -depth):
const height = -z_EC; +
import {
WGS_72,
degrees,
destination,
eulerZYXToRotationMatrix,
multiply,
normalize,
radians,
toGeodeticCoordinates,
toRotationMatrix,
transform,
type Vector,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 2: B and delta to C
*
* Given the position of vehicle B and a bearing and distance to an object C.
* Find the exact position of C. Use WGS-72 ellipsoid.
*
* @see https://www.ffi.no/en/research/n-vector/#example_2
*/
test("Example 2", () => {
// PROBLEM:

// A radar or sonar attached to a vehicle B (Body coordinate frame) measures
// the distance and direction to an object C. We assume that the distance and
// two angles measured by the sensor (typically bearing and elevation relative
// to B) are already converted (by converting from spherical to Cartesian
// coordinates) to the vector bcB (i.e. the vector from B to C, decomposed in
// B):
const bcB: Vector = [3000, 2000, 100];

// The position of B is given as an n-vector and a depth:
const b = normalize([1, 2, 3]);
const bDepth = -400;

// The orientation (attitude) of B is given as rNB, specified as yaw, pitch,
// roll:
const rNB = eulerZYXToRotationMatrix(radians(10), radians(20), radians(30));

// Use the WGS-72 ellipsoid:
const e = WGS_72;

// Find the exact position of object C as an n-vector and a depth.

// SOLUTION:

// Step 1
//
// The delta vector is given in B. It should be decomposed in E before using
// it, and thus we need rEB. This matrix is found from the matrices rEN and
// rNB, and we need to find rEN, as in Example 1:
const rEN = toRotationMatrix(b);

// Step 2
//
// Now, we can find rEB y using that the closest frames cancel when
// multiplying two rotation matrices (i.e. N is cancelled here):
const rEB = multiply(rEN, rNB);

// Step 3
//
// The delta vector is now decomposed in E:
const bcE = transform(rEB, bcB);

// Step 4
//
// It is now easy to find the position of C using destination (with custom
// ellipsoid overriding the default WGS-84):
const [c, cDepth] = destination(b, bcE, bDepth, e);

// Use human-friendly outputs:
const [lat, lon] = toGeodeticCoordinates(c);
const height = -cDepth;

expect(degrees(lat)).toBeCloseTo(53.32637826433107, 13);
expect(degrees(lon)).toBeCloseTo(63.46812343514746, 13);
expect(height).toBeCloseTo(406.0071960700098, 15);
});

Example 3: ECEF-vector to geodetic latitude

Illustration of example 3

@@ -35,7 +37,7 @@ height (using WGS-84 ellipsoid).

https://www.ffi.no/en/research/n-vector/#example_3

-
import {
apply,
deg,
n_E2lat_long,
p_EB_E2n_EB_E,
type Vector3,
} from "nvector-geodesy";

// Position B is given as p_EB_E ("ECEF-vector")
const p_EB_E: Vector3 = apply((n) => n * 6371e3, [0.71, -0.72, 0.1]); // m

// Find position B as geodetic latitude, longitude and height

// SOLUTION:

// Find n-vector from the p-vector:
const [n_EB_E, z_EB] = p_EB_E2n_EB_E(p_EB_E);

// Convert to lat, long and height:
const [lat_EB, long_EB] = n_E2lat_long(n_EB_E);
const h_EB = -z_EB; +
import {
apply,
degrees,
fromECEF,
toGeodeticCoordinates,
type Vector,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 3: ECEF-vector to geodetic latitude
*
* Given an ECEF-vector of a position. Find geodetic latitude, longitude and
* height (using WGS-84 ellipsoid).
*
* @see https://www.ffi.no/en/research/n-vector/#example_3
*/
test("Example 3", () => {
// PROBLEM:

// Position B is given as an “ECEF-vector” pb (i.e. a vector from E, the
// center of the Earth, to B, decomposed in E):
const pb: Vector = apply((n) => n * 6371e3, [0.71, -0.72, 0.1]);

// Find the geodetic latitude, longitude and height, assuming WGS-84
// ellipsoid.

// SOLUTION:

// Step 1
//
// We have a function that converts ECEF-vectors to n-vectors:
const [b, bDepth] = fromECEF(pb);

// Step 2
//
// Find latitude, longitude and height:
const [lat, lon] = toGeodeticCoordinates(b);
const height = -bDepth;

expect(degrees(lat)).toBeCloseTo(5.685075734513181, 14);
expect(degrees(lon)).toBeCloseTo(-45.40066325579215, 14);
expect(height).toBeCloseTo(95772.10761821801, 15);
});

Example 4: Geodetic latitude to ECEF-vector

Illustration of example 4

@@ -43,7 +45,7 @@ WGS-84 ellipsoid).

https://www.ffi.no/en/research/n-vector/#example_4

-
import { lat_long2n_E, n_EB_E2p_EB_E, rad } from "nvector-geodesy";

// Position B is given with lat, long and height:
const lat_EB_deg = 1;
const long_EB_deg = 2;
const h_EB = 3;

// Find the vector p_EB_E ("ECEF-vector")

// SOLUTION:

// Step1: Convert to n-vector:
const n_EB_E = lat_long2n_E(rad(lat_EB_deg), rad(long_EB_deg));

// Step2: Find the ECEF-vector p_EB_E:
const p_EB_E = n_EB_E2p_EB_E(n_EB_E, -h_EB); +
import { fromGeodeticCoordinates, radians, toECEF } from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 4: Geodetic latitude to ECEF-vector
*
* Given geodetic latitude, longitude and height. Find the ECEF-vector (using
* WGS-84 ellipsoid).
*
* @see https://www.ffi.no/en/research/n-vector/#example_4
*/
test("Example 4", () => {
// PROBLEM:

// Geodetic latitude, longitude and height are given for position B:
const bLat = 1;
const bLon = 2;
const bHeight = 3;

// Find the ECEF-vector for this position.

// SOLUTION:

// Step 1: First, the given latitude and longitude are converted to n-vector:
const b = fromGeodeticCoordinates(radians(bLat), radians(bLon));

// Step 2: Convert to an ECEF-vector:
const pb = toECEF(b, -bHeight);

expect(pb[0]).toBeCloseTo(6373290.277218279, 8);
expect(pb[1]).toBeCloseTo(222560.2006747365, 8);
expect(pb[2]).toBeCloseTo(110568.8271817859, 8);
});

Example 5: Surface distance

Illustration of example 5

@@ -51,7 +53,7 @@ distance) and the Euclidean distance.

https://www.ffi.no/en/research/n-vector/#example_5

-
import {
apply,
cross,
dot,
lat_long2n_E,
norm,
rad,
unit,
type Vector3,
} from "nvector-geodesy";

// Position A and B are given as n_EA_E and n_EB_E:
// Enter elements directly:
// const n_EA_E = unit([1, 0, -2]);
// const n_EB_E = unit([-1, -2, 0]);

// or input as lat/long in deg:
const n_EA_E = lat_long2n_E(rad(88), rad(0));
const n_EB_E = lat_long2n_E(rad(89), rad(-170));

// m, mean Earth radius
const r_Earth = 6371e3;

// SOLUTION:

// The great circle distance is given by equation (16) in Gade (2010):
// Well conditioned for all angles:
const s_AB =
Math.atan2(norm(cross(n_EA_E, n_EB_E)), dot(n_EA_E, n_EB_E)) * r_Earth;

// The Euclidean distance is given by:
const d_AB =
norm(apply((n_EB_E, n_EA_E) => n_EB_E - n_EA_E, n_EB_E, n_EA_E)) * r_Earth; +
import {
apply,
cross,
dot,
fromGeodeticCoordinates,
norm,
radians,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 5: Surface distance
*
* Given position A and B. Find the surface distance (i.e. great circle
* distance) and the Euclidean distance.
*
* @see https://www.ffi.no/en/research/n-vector/#example_5
*/
test("Example 5", () => {
// PROBLEM:

// Given two positions A and B as n-vectors:
const a = fromGeodeticCoordinates(radians(88), radians(0));
const b = fromGeodeticCoordinates(radians(89), radians(-170));

// Find the surface distance (i.e. great circle distance). The heights of A
// and B are not relevant (i.e. if they do not have zero height, we seek the
// distance between the points that are at the surface of the Earth, directly
// above/below A and B). The Euclidean distance (chord length) should also be
// found.

// Use Earth radius r:
const r = 6371e3;

// SOLUTION:

// Find the great circle distance:
const gcd = Math.atan2(norm(cross(a, b)), dot(a, b)) * r;

// Find the Euclidean distance:
const ed = norm(apply((b, a) => b - a, b, a)) * r;

expect(gcd).toBeCloseTo(332456.4441053448, 9);
expect(ed).toBeCloseTo(332418.7248568097, 9);
});

Example 6: Interpolated position

Illustration of example 6

@@ -59,7 +61,7 @@ interpolated position at time ti.

https://www.ffi.no/en/research/n-vector/#example_6

-
import {
apply,
deg,
lat_long2n_E,
n_E2lat_long,
rad,
unit,
type Vector3,
} from "nvector-geodesy";

// Position B is given at time t0 as n_EB_E_t0 and at time t1 as n_EB_E_t1:
// Enter elements directly:
// const n_EB_E_t0 = unit([1, 0, -2]);
// const n_EB_E_t1 = unit([-1, -2, 0]);

// or input as lat/long in deg:
const n_EB_E_t0 = lat_long2n_E(rad(89.9), rad(-150));
const n_EB_E_t1 = lat_long2n_E(rad(89.9), rad(150));

// The times are given as:
const t0 = 10;
const t1 = 20;
const ti = 16; // time of interpolation

// Find the interpolated position at time ti, n_EB_E_ti

// SOLUTION:

// Using standard interpolation:
const n_EB_E_ti = unit(
apply(
(n_EB_E_t0, n_EB_E_t1) =>
n_EB_E_t0 + ((ti - t0) * (n_EB_E_t1 - n_EB_E_t0)) / (t1 - t0),
n_EB_E_t0,
n_EB_E_t1,
),
);

// When displaying the resulting position for humans, it is more convenient
// to see lat, long:
const [lat_EB_ti, long_EB_ti] = n_E2lat_long(n_EB_E_ti); +
import {
apply,
degrees,
fromGeodeticCoordinates,
normalize,
radians,
toGeodeticCoordinates,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 6: Interpolated position
*
* Given the position of B at time t(0) and t(1). Find an interpolated position
* at time t(i).
*
* @see https://www.ffi.no/en/research/n-vector/#example_6
*/
test("Example 6", () => {
// PROBLEM:

// Given the position of B at time t0 and t1, pt0 and pt1:
const t0 = 10;
const t1 = 20;
const ti = 16;
const pt0 = fromGeodeticCoordinates(radians(89.9), radians(-150));
const pt1 = fromGeodeticCoordinates(radians(89.9), radians(150));

// Find an interpolated position at time ti, pti. All positions are given as
// n-vectors.

// SOLUTION:

// Standard interpolation can be used directly with n-vector:
const pti = normalize(
apply((pt0, pt1) => pt0 + ((ti - t0) * (pt1 - pt0)) / (t1 - t0), pt0, pt1),
);

// Use human-friendly outputs:
const [lat, lon] = toGeodeticCoordinates(pti);

expect(degrees(lat)).toBeCloseTo(89.91282199988446, 12);
expect(degrees(lon)).toBeCloseTo(173.4132244463705, 12);
});

Example 7: Mean position/center

Illustration of example 7

@@ -67,7 +69,7 @@ (center/midpoint).

https://www.ffi.no/en/research/n-vector/#example_7

-
import { apply, lat_long2n_E, rad, unit, type Vector3 } from "nvector-geodesy";

// Three positions A, B and C are given:
// Enter elements directly:
// const n_EA_E = unit([1, 0, -2]);
// const n_EB_E = unit([-1, -2, 0]);
// const n_EC_E = unit([0, -2, 3]);

// or input as lat/long in degrees:
const n_EA_E = lat_long2n_E(rad(90), rad(0));
const n_EB_E = lat_long2n_E(rad(60), rad(10));
const n_EC_E = lat_long2n_E(rad(50), rad(-20));

// SOLUTION:

// Find the horizontal mean position, M:
const n_EM_E = unit(
apply(
(n_EA_E, n_EB_E, n_EC_E) => n_EA_E + n_EB_E + n_EC_E,
n_EA_E,
n_EB_E,
n_EC_E,
),
); +
import {
apply,
fromGeodeticCoordinates,
normalize,
radians,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 7: Mean position/center
*
* Given three positions A, B, and C. Find the mean position (center/midpoint).
*
* @see https://www.ffi.no/en/research/n-vector/#example_7
*/
test("Example 7", () => {
// PROBLEM:

// Three positions A, B, and C are given as n-vectors:
const a = fromGeodeticCoordinates(radians(90), radians(0));
const b = fromGeodeticCoordinates(radians(60), radians(10));
const c = fromGeodeticCoordinates(radians(50), radians(-20));

// Find the mean position, M. Note that the calculation is independent of the
// heights/depths of the positions.

// SOLUTION:

// The mean position is simply given by the mean n-vector:
const m = normalize(apply((a, b, c) => a + b + c, a, b, c));

expect(m[0]).toBeCloseTo(0.3841171702926, 16);
expect(m[1]).toBeCloseTo(-0.04660240548568945, 16);
expect(m[2]).toBeCloseTo(0.9221074857571395, 16);
});

Example 8: A and azimuth/distance to B

Illustration of example 8

@@ -75,7 +77,7 @@ the destination point B.

https://www.ffi.no/en/research/n-vector/#example_8

-
import {
R_Ee_NP_Z,
apply,
cross,
deg,
lat_long2n_E,
n_E2lat_long,
rad,
rotate,
transpose,
unit,
type Vector3,
} from "nvector-geodesy";

// Position A is given as n_EA_E:
// Enter elements directly:
// const n_EA_E = unit([1, 0, -2]);

// or input as lat/long in deg:
const n_EA_E = lat_long2n_E(rad(80), rad(-90));

// The initial azimuth and great circle distance (s_AB), and Earth radius
// (r_Earth) are also given:
const azimuth = rad(200);
const s_AB = 1000; // m
const r_Earth = 6371e3; // m, mean Earth radius

// Find the destination point B, as n_EB_E ("The direct/first geodetic
// problem" for a sphere)

// SOLUTION:

// Step1: Find unit vectors for north and east (see equations (9) and (10)
// in Gade (2010):
const k_east_E = unit(cross(rotate(transpose(R_Ee_NP_Z), [1, 0, 0]), n_EA_E));
const k_north_E = cross(n_EA_E, k_east_E);

// Step2: Find the initial direction vector d_E:
const d_E = apply(
(k_north_E, k_east_E) =>
k_north_E * Math.cos(azimuth) + k_east_E * Math.sin(azimuth),
k_north_E,
k_east_E,
);

// Step3: Find n_EB_E:
const n_EB_E = apply(
(n_EA_E, d_E) =>
n_EA_E * Math.cos(s_AB / r_Earth) + d_E * Math.sin(s_AB / r_Earth),
n_EA_E,
d_E,
);

// When displaying the resulting position for humans, it is more convenient
// to see lat, long:
const [lat_EB, long_EB] = n_E2lat_long(n_EB_E); +
import {
Z_AXIS_NORTH,
apply,
cross,
degrees,
fromGeodeticCoordinates,
normalize,
radians,
toGeodeticCoordinates,
transform,
transpose,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 8: A and azimuth/distance to B
*
* Given position A and an azimuth/bearing and a (great circle) distance. Find
* the destination point B.
*
* @see https://www.ffi.no/en/research/n-vector/#example_8
*/
test("Example 8", () => {
// PROBLEM:

// Position A is given as n-vector:
const a = fromGeodeticCoordinates(radians(80), radians(-90));

// We also have an initial direction of travel given as an azimuth (bearing)
// relative to north (clockwise), and finally the distance to travel along a
// great circle is given:
const azimuth = radians(200);
const gcd = 1000;

// Use Earth radius r:
const r = 6371e3;

// Find the destination point B.
//
// In geodesy, this is known as "The first geodetic problem" or "The direct
// geodetic problem" for a sphere, and we see that this is similar to Example
// 2, but now the delta is given as an azimuth and a great circle distance.
// "The second/inverse geodetic problem" for a sphere is already solved in
// Examples 1 and 5.

// SOLUTION:

// The azimuth (relative to north) is a singular quantity (undefined at the
// Poles), but from this angle we can find a (non-singular) quantity that is
// more convenient when working with vector algebra: a vector d that points in
// the initial direction. We find this from azimuth by first finding the north
// and east vectors at the start point, with unit lengths.
//
// Here we have assumed that our coordinate frame E has its z-axis along the
// rotational axis of the Earth, pointing towards the North Pole. Hence, this
// axis is given by [1, 0, 0]:
const e = normalize(cross(transform(transpose(Z_AXIS_NORTH), [1, 0, 0]), a));
const n = cross(a, e);

// The two vectors n and e are horizontal, orthogonal, and span the tangent
// plane at the initial position. A unit vector d in the direction of the
// azimuth is now given by:
const d = apply(
(n, e) => n * Math.cos(azimuth) + e * Math.sin(azimuth),
n,
e,
);

// With the initial direction given as d instead of azimuth, it is now quite
// simple to find b. We know that d and a are orthogonal, and they will span
// the plane where b will lie. Thus, we can use sin and cos in the same manner
// as above, with the angle traveled given by gcd / r:
const b = apply(
(a, d) => a * Math.cos(gcd / r) + d * Math.sin(gcd / r),
a,
d,
);

// Use human-friendly outputs:
const [lat, lon] = toGeodeticCoordinates(b);

expect(degrees(lat)).toBeCloseTo(79.99154867339445, 13);
expect(degrees(lon)).toBeCloseTo(-90.01769837291397, 13);
});

Example 9: Intersection of two paths

Illustration of example 9

@@ -84,7 +86,7 @@ of the two paths.

https://www.ffi.no/en/research/n-vector/#example_9

-
import {
apply,
cross,
deg,
dot,
lat_long2n_E,
n_E2lat_long,
rad,
unit,
type Vector3,
} from "nvector-geodesy";

// Two paths A and B are given by two pairs of positions:
// Enter elements directly:
// const n_EA1_E = unit([0, 0, 1]);
// const n_EA2_E = unit([-1, 0, 1]);
// const n_EB1_E = unit([-2, -2, 4]);
// const n_EB2_E = unit([-2, 2, 2]);

// or input as lat/long in deg:
const n_EA1_E = lat_long2n_E(rad(50), rad(180));
const n_EA2_E = lat_long2n_E(rad(90), rad(180));
const n_EB1_E = lat_long2n_E(rad(60), rad(160));
const n_EB2_E = lat_long2n_E(rad(80), rad(-140));

// SOLUTION:

// Find the intersection between the two paths, n_EC_E:
const n_EC_E_tmp = unit(
cross(cross(n_EA1_E, n_EA2_E), cross(n_EB1_E, n_EB2_E)),
);

// n_EC_E_tmp is one of two solutions, the other is -n_EC_E_tmp. Select the
// one that is closest to n_EA1_E, by selecting sign from the dot product
// between n_EC_E_tmp and n_EA1_E:
const n_EC_E = apply(
(n) => Math.sign(dot(n_EC_E_tmp, n_EA1_E)) * n,
n_EC_E_tmp,
);

// When displaying the resulting position for humans, it is more convenient
// to see lat, long:
const [lat_EC, long_EC] = n_E2lat_long(n_EC_E); +
import {
apply,
cross,
degrees,
dot,
fromGeodeticCoordinates,
normalize,
radians,
toGeodeticCoordinates,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 9: Intersection of two paths
*
* Given path A going through A(1) and A(2), and path B going through B(1) and
* B(2). Find the intersection of the two paths.
*
* @see https://www.ffi.no/en/research/n-vector/#example_9
*/
test("Example 9", () => {
// PROBLEM:

// Define a path from two given positions (at the surface of a spherical
// Earth), as the great circle that goes through the two points (assuming that
// the two positions are not antipodal).

// Path A is given by a1 and a2:
const a1 = fromGeodeticCoordinates(radians(50), radians(180));
const a2 = fromGeodeticCoordinates(radians(90), radians(180));

// While path B is given by b1 and b2:
const b1 = fromGeodeticCoordinates(radians(60), radians(160));
const b2 = fromGeodeticCoordinates(radians(80), radians(-140));

// Find the position C where the two paths intersect.

// SOLUTION:

// A convenient way to represent a great circle is by its normal vector (i.e.
// the normal vector to the plane containing the great circle). This normal
// vector is simply found by taking the cross product of the two n-vectors
// defining the great circle (path). Having the normal vectors to both paths,
// the intersection is now simply found by taking the cross product of the two
// normal vectors:
const cTmp = normalize(cross(cross(a1, a2), cross(b1, b2)));

// Note that there will be two places where the great circles intersect, and
// thus two solutions are found. Selecting the solution that is closest to
// e.g. a1 can be achieved by selecting the solution that has a positive dot
// product with a1 (or the mean position from Example 7 could be used instead
// of a1):
const c = apply((n) => Math.sign(dot(cTmp, a1)) * n, cTmp);

// Use human-friendly outputs:
const [lat, lon] = toGeodeticCoordinates(c);

expect(degrees(lat)).toBeCloseTo(74.16344802135536, 16);
expect(degrees(lon)).toBeCloseTo(180, 16);
});

Example 10: Cross track distance (cross track error)

Illustration of example 10

@@ -93,7 +95,7 @@ the path.

https://www.ffi.no/en/research/n-vector/#example_10

-
import {
cross,
dot,
lat_long2n_E,
rad,
unit,
type Vector3,
} from "nvector-geodesy";

// Position A1 and A2 and B are given as n_EA1_E, n_EA2_E, and n_EB_E:
// Enter elements directly:
// const n_EA1_E = unit([1, 0, -2]);
// const n_EA2_E = unit([-1, -2, 0]);
// const n_EB_E = unit([0, -2, 3]);

// or input as lat/long in deg:
const n_EA1_E = lat_long2n_E(rad(0), rad(0));
const n_EA2_E = lat_long2n_E(rad(10), rad(0));
const n_EB_E = lat_long2n_E(rad(1), rad(0.1));

const r_Earth = 6371e3; // m, mean Earth radius

// Find the cross track distance from path A to position B.

// SOLUTION:

// Find the unit normal to the great circle between n_EA1_E and n_EA2_E:
const c_E = unit(cross(n_EA1_E, n_EA2_E));

// Find the great circle cross track distance: (acos(x) - pi/2 = -asin(x))
const s_xt = -Math.asin(dot(c_E, n_EB_E)) * r_Earth;

// Find the Euclidean cross track distance:
const d_xt = -dot(c_E, n_EB_E) * r_Earth; +
import {
cross,
dot,
fromGeodeticCoordinates,
normalize,
radians,
} from "nvector-geodesy";
import { expect, test } from "vitest";

/**
* Example 10: Cross track distance (cross track error)
*
* Given path A going through A(1) and A(2), and a point B. Find the cross track
* distance/cross track error between B and the path.
*
* @see https://www.ffi.no/en/research/n-vector/#example_10
*/
test("Example 10", () => {
// PROBLEM:

// Path A is given by the two n-vectors a1 and a2 (as in the previous
// example):
const a1 = fromGeodeticCoordinates(radians(0), radians(0));
const a2 = fromGeodeticCoordinates(radians(10), radians(0));

// And a position B is given by b:
const b = fromGeodeticCoordinates(radians(1), radians(0.1));

// Find the cross track distance between the path A (i.e. the great circle
// through a1 and a2) and the position B (i.e. the shortest distance at the
// surface, between the great circle and B). Also, find the Euclidean distance
// between B and the plane defined by the great circle.

// Use Earth radius r:
const r = 6371e3;

// SOLUTION:

// First, find the normal to the great circle, with direction given by the
// right hand rule and the direction of travel:
const c = normalize(cross(a1, a2));

// Find the great circle cross track distance:
const gcd = -Math.asin(dot(c, b)) * r;

// Finding the Euclidean distance is even simpler, since it is the projection
// of b onto c, thus simply the dot product:
const ed = -dot(c, b) * r;

// For both gcd and ed, positive answers means that B is to the right of the
// track.

expect(gcd).toBeCloseTo(11117.79911014538, 9);
expect(ed).toBeCloseTo(11117.79346740667, 9);
});

Methodology

If you look at the test suite for this library, you'll see that there are very few concrete test cases. Instead, this library uses model-based testing, powered diff --git a/modules.html b/modules.html index 5e08421..33f6ac2 100644 --- a/modules.html +++ b/modules.html @@ -1,34 +1,33 @@ nvector-geodesy

\ No newline at end of file diff --git a/types/Ellipsoid.html b/types/Ellipsoid.html index d288cfb..9448d9f 100644 --- a/types/Ellipsoid.html +++ b/types/Ellipsoid.html @@ -1,4 +1,5 @@ -Ellipsoid | nvector-geodesy

Type alias Ellipsoid

Ellipsoid: {
    a: number;
    f: number;
}

An ellipsoid.

-

Type declaration

  • a: number

    The semi-major axis of the ellipsoid.

    +Ellipsoid | nvector-geodesy

    Type alias Ellipsoid

    Ellipsoid: {
        a: number;
        b: number;
        f: number;
    }

    An ellipsoid.

    +

    Type declaration

    • a: number

      The semi-major axis of the ellipsoid in meters.

      +
    • b: number

      The semi-minor axis of the ellipsoid in meters.

    • f: number

      The flattening of the ellipsoid.

      -
    \ No newline at end of file +
\ No newline at end of file diff --git a/types/Matrix3x3.html b/types/Matrix.html similarity index 56% rename from types/Matrix3x3.html rename to types/Matrix.html index 5561df0..31d2223 100644 --- a/types/Matrix3x3.html +++ b/types/Matrix.html @@ -1,2 +1,2 @@ -Matrix3x3 | nvector-geodesy

Type alias Matrix3x3

Matrix3x3: [[n11: number, n12: number, n13: number], [n21: number, n22: number, n23: number], [n31: number, n32: number, n33: number]]

A 3x3 matrix.

-
\ No newline at end of file +Matrix | nvector-geodesy

Type alias Matrix

Matrix: [[n11: number, n12: number, n13: number], [n21: number, n22: number, n23: number], [n31: number, n32: number, n33: number]]

A 3x3 matrix.

+
\ No newline at end of file diff --git a/types/Vector3.html b/types/Vector.html similarity index 54% rename from types/Vector3.html rename to types/Vector.html index c1de681..862c2c6 100644 --- a/types/Vector3.html +++ b/types/Vector.html @@ -1,2 +1,2 @@ -Vector3 | nvector-geodesy

Type alias Vector3

Vector3: [x: number, y: number, z: number]

A 3D vector.

-
\ No newline at end of file +Vector | nvector-geodesy

Type alias Vector

Vector: [x: number, y: number, z: number]

A 3D vector.

+
\ No newline at end of file diff --git a/variables/GRS_80.html b/variables/GRS_80.html index 5e3cf3b..0c5569d 100644 --- a/variables/GRS_80.html +++ b/variables/GRS_80.html @@ -1,3 +1,3 @@ GRS_80 | nvector-geodesy
\ No newline at end of file +
\ No newline at end of file diff --git a/variables/R_Ee_NP_X.html b/variables/R_Ee_NP_X.html deleted file mode 100644 index 88c5a39..0000000 --- a/variables/R_Ee_NP_X.html +++ /dev/null @@ -1,10 +0,0 @@ -R_Ee_NP_X | nvector-geodesy

Variable R_Ee_NP_XConst

R_Ee_NP_X: Matrix3x3 = ...

Axes of the coordinate frame E (Earth-Centred, Earth-Fixed, ECEF) when the -x-axis points to the North Pole.

-

The 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.

-
\ No newline at end of file diff --git a/variables/R_Ee_NP_Z.html b/variables/R_Ee_NP_Z.html deleted file mode 100644 index 78ecc5a..0000000 --- a/variables/R_Ee_NP_Z.html +++ /dev/null @@ -1,6 +0,0 @@ -R_Ee_NP_Z | nvector-geodesy

Variable R_Ee_NP_ZConst

R_Ee_NP_Z: Matrix3x3 = ...

Axes of the coordinate frame E (Earth-Centred, Earth-Fixed, ECEF) when the -z-axis points to the North Pole.

-

The 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.

-
\ No newline at end of file diff --git a/variables/WGS_72.html b/variables/WGS_72.html index f5847bc..709539d 100644 --- a/variables/WGS_72.html +++ b/variables/WGS_72.html @@ -1,3 +1,3 @@ WGS_72 | nvector-geodesy
\ No newline at end of file +
\ No newline at end of file diff --git a/variables/WGS_84.html b/variables/WGS_84.html index 0eb8b8e..062e116 100644 --- a/variables/WGS_84.html +++ b/variables/WGS_84.html @@ -1,3 +1,3 @@ WGS_84 | nvector-geodesy
\ No newline at end of file +
\ No newline at end of file diff --git a/variables/WGS_84_SPHERE.html b/variables/WGS_84_SPHERE.html deleted file mode 100644 index 1663d34..0000000 --- a/variables/WGS_84_SPHERE.html +++ /dev/null @@ -1,3 +0,0 @@ -WGS_84_SPHERE | nvector-geodesy

Variable WGS_84_SPHEREConst

WGS_84_SPHERE: Ellipsoid = ...

A sphere with the same semi-major axis as the WGS-84 ellipsoid.

-
\ No newline at end of file diff --git a/variables/X_AXIS_NORTH.html b/variables/X_AXIS_NORTH.html new file mode 100644 index 0000000..64d930c --- /dev/null +++ b/variables/X_AXIS_NORTH.html @@ -0,0 +1,10 @@ +X_AXIS_NORTH | nvector-geodesy

Variable X_AXIS_NORTHConst

X_AXIS_NORTH: Matrix = ...

Axes of the coordinate frame E (Earth-Centred, Earth-Fixed, ECEF) when the +x-axis points to the North Pole.

+

The 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.

+
\ No newline at end of file diff --git a/variables/Z_AXIS_NORTH.html b/variables/Z_AXIS_NORTH.html new file mode 100644 index 0000000..5e8a036 --- /dev/null +++ b/variables/Z_AXIS_NORTH.html @@ -0,0 +1,6 @@ +Z_AXIS_NORTH | nvector-geodesy

Variable Z_AXIS_NORTHConst

Z_AXIS_NORTH: Matrix = ...

Axes of the coordinate frame E (Earth-Centred, Earth-Fixed, ECEF) when the +z-axis points to the North Pole.

+

The 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.

+
\ No newline at end of file