---
url: /dyad/stable/stdlib/MultibodyComponents/components/Cylindrical.md
description: >-
  Dyad Cylindrical docs.  Cylindrical joint: combined prismatic and revolute
  along/around the same axis.
---

# `Cylindrical` {#Cylindrical}

Cylindrical joint: combined prismatic and revolute along/around the same axis.

Allows one translational and one rotational degree of freedom along axis `n`.

This component extends from [`PartialTwoFrames`](../types/PartialTwoFrames.md) This component extends from [`Renderable`](../types/Renderable.md)

## Usage {#Usage}

`MultibodyComponents.Cylindrical(render=true, color=world_default_joint_color(), specular_coefficient=1.5, n=[1, 0, 0], cylinder_diameter=world_default_joint_width())`

## Parameters: {#Parameters:}

|                   Name |                                           Description | Units |             Default value |
| ----------------------:| -----------------------------------------------------:| -----:| -------------------------:|
|        `statePriority` |                                                       |     – |                        10 |
|               `render` |                                                       |     – |                      true |
|                `color` |                                                       |     – | world_defau...int_color() |
| `specular_coefficient` |                                                       |     – |                       1.5 |
|                    `n` | Joint axis resolved in frame_a (= same as in frame_b) |     – |                 \[1, 0, 0] |
|    `cylinder_diameter` |                Diameter of the cylinder in animations |     – | world_defau...int_width() |

## 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))

* `frame_b` - 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))

## Variables {#Variables}

|  Name |                Description |  Units |
| -----:| --------------------------:| ------:|
|   `s` | Translational displacement |      m |
| `phi` |             Rotation angle |    rad |
|   `v` |     Translational velocity |    m/s |
|   `w` |           Angular velocity |  rad/s |
|   `a` | Translational acceleration |   m/s2 |
|  `wd` |       Angular acceleration | rad/s2 |

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
Cylindrical joint: combined prismatic and revolute along/around the same axis.

Allows one translational and one rotational degree of freedom along axis `n`.
"""
component Cylindrical
  extends PartialTwoFrames()
  extends Renderable(color = world_default_joint_color())
  prismatic = Prismatic(final n = n, render = false)
  revolute = Revolute(final n = n, render = false)
  # Visualization shape
  cylinder_shape = CylinderShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), length_direction = n, length = s, width = cylinder_diameter, height = cylinder_diameter)
  structural parameter statePriority::Integer = 10
  "Joint axis resolved in frame_a (= same as in frame_b)"
  parameter n::Real[3] = [1, 0, 0]
  "Diameter of the cylinder in animations"
  parameter cylinder_diameter::Real = world_default_joint_width()
  "Translational displacement"
  variable s::Length(statePriority = statePriority)
  "Rotation angle"
  variable phi::Angle(statePriority = statePriority)
  "Translational velocity"
  variable v::Velocity(statePriority = statePriority)
  "Angular velocity"
  variable w::AngularVelocity(statePriority = statePriority)
  "Translational acceleration"
  variable a::Acceleration
  "Angular acceleration"
  variable wd::AngularAcceleration
relations
  phi = revolute.phi
  w = der(phi)
  wd = der(w)
  s = prismatic.s
  v = der(s)
  a = der(v)
  connect(frame_a, prismatic.frame_a)
  connect(prismatic.frame_b, revolute.frame_a)
  connect(revolute.frame_b, frame_b)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Cylindrical.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 280,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

```dyad
"""
Cylindrical joint: combined prismatic and revolute along/around the same axis.

Allows one translational and one rotational degree of freedom along axis `n`.
"""
component Cylindrical
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  parameter render::Boolean = true
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  parameter specular_coefficient::Real = 1.5
  prismatic = Prismatic(final n = n, render = false)
  revolute = Revolute(final n = n, render = false)
  # Visualization shape
  cylinder_shape = CylinderShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), length_direction = n, length = s, width = cylinder_diameter, height = cylinder_diameter)
  structural parameter statePriority::Integer = 10
  "Joint axis resolved in frame_a (= same as in frame_b)"
  parameter n::Real[3] = [1, 0, 0]
  "Diameter of the cylinder in animations"
  parameter cylinder_diameter::Real = world_default_joint_width()
  "Translational displacement"
  variable s::Length(statePriority = statePriority)
  "Rotation angle"
  variable phi::Angle(statePriority = statePriority)
  "Translational velocity"
  variable v::Velocity(statePriority = statePriority)
  "Angular velocity"
  variable w::AngularVelocity(statePriority = statePriority)
  "Translational acceleration"
  variable a::Acceleration
  "Angular acceleration"
  variable wd::AngularAcceleration
relations
  phi = revolute.phi
  w = der(phi)
  wd = der(w)
  s = prismatic.s
  v = der(s)
  a = der(v)
  connect(frame_a, prismatic.frame_a)
  connect(prismatic.frame_b, revolute.frame_a)
  connect(revolute.frame_b, frame_b)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Cylindrical.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 280,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
