---
url: /dyad/stable/stdlib/MultibodyComponents/examples/examples.QuaternionBody.md
description: >-
  Dyad examples.QuaternionBody docs.  A single body floating freely with initial
  angular velocity. The body uses quaternion orientation state. With no forces
  or constraints, the ...
---

# `examples.QuaternionBody` {#examples.QuaternionBody}

# Free body with quaternion state {#Free-body-with-quaternion-state}

A single body floating freely with initial angular velocity. The body uses quaternion orientation state. With no forces or constraints, the body should rotate at constant angular velocity.

This mirrors the "Simple motion with quaternions" test in `Multibody/test/test_quaternions.jl`.

## Usage {#Usage}

`MultibodyComponents.examples.QuaternionBody()`

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
# Free body with quaternion state

A single body floating freely with initial angular velocity. The body uses
quaternion orientation state. With no forces or constraints, the body should
rotate at constant angular velocity.

This mirrors the "Simple motion with quaternions" test in
`Multibody/test/test_quaternions.jl`.
"""
example component QuaternionBody
  world = MultibodyComponents.World()
  body = MultibodyComponents.Body(m = 1, r_cm = [0.0, 0, 0], orientation_state = OrientationState.Quaternion(), w_a(initial = [1.0, 0, 0]))
relations
end
```

```dyad
"""
# Free body with quaternion state

A single body floating freely with initial angular velocity. The body uses
quaternion orientation state. With no forces or constraints, the body should
rotate at constant angular velocity.

This mirrors the "Simple motion with quaternions" test in
`Multibody/test/test_quaternions.jl`.
"""
example component QuaternionBody
  world = MultibodyComponents.World()
  body = MultibodyComponents.Body(m = 1, r_cm = [0.0, 0, 0], orientation_state = OrientationState.Quaternion(), w_a(initial = [1.0, 0, 0]))
relations
metadata {}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
