# Goal

class in `closed-chain-ik/core`, extends `Joint`

```js
import { Goal } from 'closed-chain-ik/core';
```

A frame representing a target for a connected link to reach. The degrees of freedom set on
a goal are the axes that are constrained, as opposed to the movable degrees of freedom of a
joint. A goal cannot have children and can only be connected to a link with `makeClosure`.

```js
goal.setFreeDoF();                          // all axes constrained ( default )
goal.setFreeDoF( DOF.EX, DOF.EY, DOF.EZ );  // position only goal
goal.setGoalDoF( DOF.X, DOF.Y, DOF.Z );     // position only goal
```

## Methods

### .setGoalDoF

```js
.setGoalDoF( ...dof: number )
```

Sets the axes the goal constrains. Rotation must be constrained on all three axes or
none, so `EX`, `EY`, and `EZ` must be passed together or omitted.

- `dof`, `number`: The constrained `DOF` fields.

### .setFreeDoF

```js
.setFreeDoF( ...dof: number )
```

Sets the axes the goal leaves free. Every other axis is constrained. The same rotation
restriction as `setGoalDoF` applies.

- `dof`, `number`: The free `DOF` fields.
