Implementation:SeleniumHQ Selenium Closure Math Vec2
| 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
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/math/vec2.js
- Lines: 1-322
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) { ... };