We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @antv/gl-matrix/lib/gl-matrix/vec2.direction function in @antv/gl-matrix

To help you get started, we’ve selected a few @antv/gl-matrix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / util / packages / matrix-util / src / vec2.ts View on Github external
vec2.angleTo = function (v1: number, v2: number, direct: boolean): number {
  const angle = vec2.angle(v1, v2);
  const angleLargeThanPI = vec2.direction(v1, v2) >= 0;
  if (direct) {
    if (angleLargeThanPI) {
      return Math.PI * 2 - angle;
    }

    return angle;
  }

  if (angleLargeThanPI) {
    return angle;
  }
  return Math.PI * 2 - angle;
};

@antv/gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis