> For the complete documentation index, see [llms.txt](https://yams.yassrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yams.yassrobotics.com/api-reference/java-reference/gearing/sprocket.md).

# Sprocket

**Package:** `yams.gearing`

`Sprocket` models a chain or belt drive stage. The API is identical to `GearBox`. The distinction is semantic, reflecting the physical mechanism (toothed sprockets and chain vs. meshed gears).

***

## Constructors

```java
Sprocket(double... sprocketReductionStage)
Sprocket(String[] reductionStage)   // "IN:OUT" format
```

***

## Factory Methods

| Method                                         | Description                                           |
| ---------------------------------------------- | ----------------------------------------------------- |
| `static Sprocket fromStages(String... stages)` | Creates from `"IN:OUT"` sprocket tooth count strings. |

***

## Methods

| Method                               | Returns    | Description                                                            |
| ------------------------------------ | ---------- | ---------------------------------------------------------------------- |
| `getInputToOutputConversionFactor()` | `double`   | Mechanism rotations per motor rotation (`OUT/IN`).                     |
| `getOutputToInputConversionFactor()` | `double`   | Motor rotations per mechanism rotation (`IN/OUT`).                     |
| `times(double x)`                    | `Sprocket` | Multiplies reduction by `x`. Returns the same `Sprocket` for chaining. |
| `div(double x)`                      | `Sprocket` | Divides reduction by `x`. Returns the same `Sprocket` for chaining.    |

***

## Example

```java
// 18T driving sprocket, 36T driven sprocket: 2:1 reduction
Sprocket s = Sprocket.fromStages("18:36");
```

***

## See Also

* [GearBox](/api-reference/java-reference/gearing/gearbox.md)
* [MechanismGearing](/api-reference/java-reference/gearing/mechanism-gearing.md)
