---
url: /dyad/stable/stdlib/MultibodyComponents/examples/tests.SphericalPendulumConstraint.md
description: >-
  Dyad tests.SphericalPendulumConstraint docs.  The Spherical joint is stateless
  (orientation_state = None); the Body carries the orientation state as a
  quaternion. Mirrors the "Spherical ...
---

# `tests.SphericalPendulumConstraint` {#tests.SphericalPendulumConstraint}

# Spherical Pendulum (joint as pure constraint, body holds quaternion state) {#Spherical-Pendulum-joint-as-pure-constraint,-body-holds-quaternion-state}

The Spherical joint is stateless (`orientation_state = None`); the Body carries the orientation state as a quaternion. Mirrors the "Spherical joint without state / Body with quaternion state" test in `Multibody/test/basic_tests.jl`.

## Usage {#Usage}

`MultibodyComponents.tests.SphericalPendulumConstraint()`

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
# Spherical Pendulum (joint as pure constraint, body holds quaternion state)

The Spherical joint is stateless (`orientation_state = None`); the Body carries
the orientation state as a quaternion. Mirrors the
"Spherical joint without state / Body with quaternion state" test in
`Multibody/test/basic_tests.jl`.
"""
example component SphericalPendulumConstraint
  world = MultibodyComponents.World() {}
  joint = MultibodyComponents.Spherical(orientation_state = OrientationState.None()) {}
  rod = MultibodyComponents.FixedTranslation(r = [1.0, 0, 0]) {}
  body = MultibodyComponents.Body(m = 1, orientation_state = OrientationState.Quaternion(), r_0(initial = missing), v_0(initial = missing)) {}
relations
  connect(world.frame_b, joint.frame_a) {}
  connect(joint.frame_b, rod.frame_a) {}
  connect(rod.frame_b, body.frame_a) {}
end
```

```dyad
"""
# Spherical Pendulum (joint as pure constraint, body holds quaternion state)

The Spherical joint is stateless (`orientation_state = None`); the Body carries
the orientation state as a quaternion. Mirrors the
"Spherical joint without state / Body with quaternion state" test in
`Multibody/test/basic_tests.jl`.
"""
example component SphericalPendulumConstraint
  world = MultibodyComponents.World() {}
  joint = MultibodyComponents.Spherical(orientation_state = OrientationState.None()) {}
  rod = MultibodyComponents.FixedTranslation(r = [1.0, 0, 0]) {}
  body = MultibodyComponents.Body(m = 1, orientation_state = OrientationState.Quaternion(), r_0(initial = missing), v_0(initial = missing)) {}
relations
  connect(world.frame_b, joint.frame_a) {}
  connect(joint.frame_b, rod.frame_a) {}
  connect(rod.frame_b, body.frame_a) {}
metadata {}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
