> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dairy.foundation/llms.txt
> Use this file to discover all available pages before exploring further.

# Poses

Poses are similar to vectors, a useful multidimensional data structure.

Dairy supports `DoublePose2D` and `DistancePose2D`.

We'll look at `DistancePose2D`, but `DoublePose2D` is super similar, outside
of a couple of `Distance` specific utility methods.

<CodeGroup>
  ```java Java theme={null}
  DistancePose2D pose = new DistancePose2D(DistanceVector2Ds.millimeterVector(10, 10), Angles.relativeDeg(90));

  // OR

  DistancePose2Ds.millimeterPose(10, 10, Angles.relativeDeg(90));

  DistanceVector2D vector = pose.getVector2D();
  Angle heading = pose.getHeading();
  ```

  ```kt Kotlin theme={null}
  val pose = DistancePose2D(millimeterVector(10.0, 10.0), 90.relativeDeg)
  // OR
  millimeterPose(10.0, 10.0, 90.relativeDeg)
  pose.vector2D
  pose.heading

  val (vector, heading) = pose
  ```
</CodeGroup>

That's the basics! In Kotlin, we also get that cool destructuring to `vector` and
`heading`.

Poses also have all expected mathematical operations defined on them: plus
another pose, plus a vector, plus a heading, minus another pose, minus a
vector, minus a heading, unaryPlus, unaryMinus, times by scalar, div by scalar.
Take a look back at `Distance`s in the `Unit` section to review this. The only
operations not defined here is `mod` or `rem`, as well as times and div by other
poses or vectors.

Poses don't have any specific utilities, other than for doing intos for the
`heading` `Angle`, which we won't look at, as we've already reviewed these
looking at `Angles`s themselves.

`DistancePose2D`s also have utilities for working with the `DistanceUnit`s of
the `DistanceVector2D` it stores.

<CodeGroup>
  ```java Java theme={null}
  // converts x to FOOT, y to CENTIMETER
  pose.into(DistanceUnits.FOOT, DistanceUnits.CENTIMETER);
  // converts both x and y to FOOT
  pose.into(DistanceUnits.FOOT);

  pose.intoMillimeters();
  pose.intoCentimeters();
  pose.intoMeters();
  pose.intoInches();
  pose.intoFeet();
  ```

  ```kt Kotlin theme={null}
  // converts x to FOOT, y to CENTIMETER
  pose.into(DistanceUnits.FOOT, DistanceUnits.CENTIMETER)
  // converts both x and y to FOOT
  pose.into(DistanceUnits.FOOT)

  pose.intoMillimeters()
  pose.intoCentimeters()
  pose.intoMeters()
  pose.intoInches()
  pose.intoFeet()
  ```
</CodeGroup>
