aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts
blob: 027b99a52e56272c989146b9a89c03ef3ce5cecd (plain)
1
2
3
4
5
6
7
8
9
10
11
import { Point } from "./generativeFillInterfaces";

export class GenerativeFillMathHelpers {
  // math helpers
  static distanceBetween = (p1: Point, p2: Point) => {
    return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
  };
  static angleBetween = (p1: Point, p2: Point) => {
    return Math.atan2(p2.x - p1.x, p2.y - p1.y);
  };
}