# `BB.Message.Geometry.Twist2D`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/message/geometry/twist2d.ex#L5)

Linear and angular velocity within a plane.

The planar counterpart of `BB.Message.Geometry.Twist`, and the velocity of a
`:planar` joint. `vx`/`vy` are in the plane spanned by the joint's `axis`
normal, and `omega` is about that normal — the same basis
`BB.Math.Transform2D.to_transform/2` uses.

Using the 3D `Twist` with the out-of-plane components zeroed would let a
producer emit a physically impossible out-of-plane velocity that nothing would
reject.

## Fields

- `vx` - In-plane linear velocity along the plane's first axis, in m/s
- `vy` - In-plane linear velocity along the plane's second axis, in m/s
- `omega` - Angular velocity about the plane's normal, in rad/s

## Examples

    alias BB.Message.Geometry.Twist2D

    {:ok, msg} = Twist2D.new(:chassis, 0.5, 0.0, 0.1)

# `t`

```elixir
@type t() :: %BB.Message.Geometry.Twist2D{omega: float(), vx: float(), vy: float()}
```

# `new`

```elixir
@spec new(
  atom(),
  keyword()
) :: {:ok, BB.Message.t()} | {:error, term()}
```

# `new`

```elixir
@spec new(atom(), number(), number(), number()) ::
  {:ok, BB.Message.t()} | {:error, term()}
```

Create a new Twist2D message.

Returns `{:ok, %BB.Message{}}` with the twist as payload.

## Examples

    {:ok, msg} = Twist2D.new(:chassis, 0.5, 0.0, 0.1)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
