---
url: /dyad/stable/stdlib/MultibodyComponents/components/AbsoluteAngles.md
description: >-
  Dyad AbsoluteAngles docs.  Measures absolute Euler/Cardan angles of a frame
  relative to the world.
---

# `AbsoluteAngles` {#AbsoluteAngles}

Measures absolute Euler/Cardan angles of a frame relative to the world.

Computes the three rotation angles of `frame_a` for the given axis `sequence` (default: \[1,2,3] = XYZ). This is a sensor: no forces or torques are exerted.

## Usage {#Usage}

`MultibodyComponents.AbsoluteAngles()`

## Parameters: {#Parameters:}

|       Name | Description | Units | Default value |
| ----------:| -----------:| -----:| -------------:|
| `sequence` |             |     – |     \[1, 2, 3] |

## Connectors {#Connectors}

* `frame_a` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

* `angle_1` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

* `angle_2` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

* `angle_3` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Variables {#Variables}

|     Name | Description | Units |
| --------:| -----------:| -----:|
| `angles` |             |   rad |

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{frame_a.f}\_{1}\left( t \right) &= 0 \\
\mathtt{frame_a.f}\_{2}\left( t \right) &= 0 \\
\mathtt{frame_a.f}\_{3}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{1}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{2}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{3}\left( t \right) &= 0 \\
\mathtt{angles}\_{1}\left( t \right) &= ifelse\left( \left( \left|\mathtt{frame_a.R}\_{3,2}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right) \wedge \left( \left|\mathtt{frame_a.R}\_{3,3}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right), 0, ifelse\left( \left|\arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right| \leq \left|\arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right|, \arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right), \arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right) \right) \right) \\
\mathtt{angles}\_{2}\left( t \right) &= \arctan\left( \mathtt{frame_a.R}\_{3,1}\left( t \right), \cos\left( ifelse\left( \left( \left|\mathtt{frame_a.R}\_{3,2}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right) \wedge \left( \left|\mathtt{frame_a.R}\_{3,3}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right), 0, ifelse\left( \left|\arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right| \leq \left|\arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right|, \arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right), \arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right) \right) \right) \right) ~ \mathtt{frame_a.R}\_{3,3}\left( t \right) - \mathtt{frame_a.R}\_{3,2}\left( t \right) ~ \sin\left( ifelse\left( \left( \left|\mathtt{frame_a.R}\_{3,2}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right) \wedge \left( \left|\mathtt{frame_a.R}\_{3,3}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right), 0, ifelse\left( \left|\arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right| \leq \left|\arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right|, \arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right), \arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right) \right) \right) \right) \right) \\
\mathtt{angles}\_{3}\left( t \right) &= \arctan\left( \cos\left( ifelse\left( \left( \left|\mathtt{frame_a.R}\_{3,2}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right) \wedge \left( \left|\mathtt{frame_a.R}\_{3,3}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right), 0, ifelse\left( \left|\arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right| \leq \left|\arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right|, \arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right), \arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right) \right) \right) \right) ~ \mathtt{frame_a.R}\_{1,2}\left( t \right) + \mathtt{frame_a.R}\_{1,3}\left( t \right) ~ \sin\left( ifelse\left( \left( \left|\mathtt{frame_a.R}\_{3,2}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right) \wedge \left( \left|\mathtt{frame_a.R}\_{3,3}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right), 0, ifelse\left( \left|\arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right| \leq \left|\arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right|, \arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right), \arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right) \right) \right) \right), \cos\left( ifelse\left( \left( \left|\mathtt{frame_a.R}\_{3,2}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right) \wedge \left( \left|\mathtt{frame_a.R}\_{3,3}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right), 0, ifelse\left( \left|\arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right| \leq \left|\arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right|, \arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right), \arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right) \right) \right) \right) ~ \mathtt{frame_a.R}\_{2,2}\left( t \right) + \mathtt{frame_a.R}\_{2,3}\left( t \right) ~ \sin\left( ifelse\left( \left( \left|\mathtt{frame_a.R}\_{3,2}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right) \wedge \left( \left|\mathtt{frame_a.R}\_{3,3}\left( t \right)\right| \leq 1 \cdot 10^{-12} \right), 0, ifelse\left( \left|\arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right| \leq \left|\arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right)\right|, \arctan\left( \mathtt{frame_a.R}\_{3,2}\left( t \right),  - \mathtt{frame_a.R}\_{3,3}\left( t \right) \right), \arctan\left(  - \mathtt{frame_a.R}\_{3,2}\left( t \right), \mathtt{frame_a.R}\_{3,3}\left( t \right) \right) \right) \right) \right) \right) \\
\mathtt{angle_1}\left( t \right) &= \mathtt{angles}\_{1}\left( t \right) \\
\mathtt{angle_2}\left( t \right) &= \mathtt{angles}\_{2}\left( t \right) \\
\mathtt{angle_3}\left( t \right) &= \mathtt{angles}\_{3}\left( t \right)
\end{align}
$$

## Source {#Source}

```dyad
"""
Measures absolute Euler/Cardan angles of a frame relative to the world.

Computes the three rotation angles of `frame_a` for the given axis
`sequence` (default: [1,2,3] = XYZ).
This is a sensor: no forces or torques are exerted.
"""
component AbsoluteAngles
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter sequence::Integer[3] = [1, 2, 3]
  angle_1 = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 100, "x2": 1060, "y2": 200, "rot": 0}
      },
      "tags": []
    }
  }
  angle_2 = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  angle_3 = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 780, "x2": 1060, "y2": 880, "rot": 0}
      },
      "tags": []
    }
  }
  variable angles::Angle[3]
relations
  # Sensor exerts no forces or torques
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
  # Extract angles from absolute orientation
  angles = axes_rotationangles(frame_a.R, sequence)
  [angle_1, angle_2, angle_3] = angles
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      },
      {"label": "abs ang", "x": 500, "y": 680, "rot": 0}
    ]
  }
}
end
```

```dyad
"""
Measures absolute Euler/Cardan angles of a frame relative to the world.

Computes the three rotation angles of `frame_a` for the given axis
`sequence` (default: [1,2,3] = XYZ).
This is a sensor: no forces or torques are exerted.
"""
component AbsoluteAngles
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter sequence::Integer[3] = [1, 2, 3]
  angle_1 = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 100, "x2": 1060, "y2": 200, "rot": 0}
      },
      "tags": []
    }
  }
  angle_2 = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  angle_3 = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 780, "x2": 1060, "y2": 880, "rot": 0}
      },
      "tags": []
    }
  }
  variable angles::Angle[3]
relations
  # Sensor exerts no forces or torques
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
  # Extract angles from absolute orientation
  angles = axes_rotationangles(frame_a.R, sequence)
  [angle_1, angle_2, angle_3] = angles
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      },
      {"label": "abs ang", "x": 500, "y": 680, "rot": 0}
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`PlanarToMultiBodyEmbeddedTest`](AbsoluteAngles.md)

  * [`PlanarToMultiBodyKinematicTest`](AbsoluteAngles.md)

  * [`PlanarToMultiBodyPendulumTest`](AbsoluteAngles.md)
