UNPKG

constraint-solver-js

Version:

2D rigid body constraint solver written in typescript.

12 lines (11 loc) 260 B
export class FixedConstraint { constructor(body) { this.x = body.x; this.y = body.y; this.theta = body.theta; this.body = body; } f(x, y, theta) { return [x - this.x, y - this.y, theta - this.theta]; } }