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.vertical 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
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;
};

vec2.vertical = function (out: number[], v: number[], flag: boolean): number[] {
  if (flag) {
    out[0] = v[1];
    out[1] = -1 * v[0];
  } else {
    out[0] = -1 * v[1];
    out[1] = v[0];
  }

  return out;
};

export default vec2;

@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