Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeleniumHQ Selenium Closure Math Vec2

From Leeroopedia
Knowledge Sources
Domains JavaScript_Atoms, Vendored_Library
Last Updated 2026-02-12 00:00 GMT

Overview

Vendored Google Closure Library module providing a 2D vector class used by Selenium JavaScript atoms.

Description

goog.math.Vec2 is a vendored copy of the Google Closure Library module. It defines a 2-element vector class useful for coordinate math, animation systems, and point manipulation. Vec2 extends goog.math.Coordinate and can be used wherever a Coordinate is required. It provides static methods for generating random unit vectors, random vectors within the unit disc, and conversion from Coordinate objects. Selenium uses this as part of its JavaScript atom infrastructure.

Usage

This module is consumed internally by Selenium's JavaScript atoms build system. Not imported directly by end users.

Code Reference

Source Location

Key Exports

goog.provide('goog.math.Vec2');

goog.math.Vec2 = function(x, y) { ... };
goog.utils.inherits(goog.math.Vec2, goog.math.Coordinate);
goog.math.Vec2.randomUnit = function() { ... };
goog.math.Vec2.random = function() { ... };
goog.math.Vec2.fromCoordinate = function(a) { ... };

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment