declare class Vec2D { x: number; y: number; /** * A 2D vector. * * @param x X-coordinate * @param y Y-coordinate * @return New Vec2D object */ constructor(x: number, y: number); /** * Create a copy of the current vector. * * @return New Vec2D object */ copy(): Vec2D; /** * Test if a vector is equivalent to the current one. * * @param b Other vector * @return Are the vectors equal? */ equals(b: Vec2D): boolean; /** * Add a new vector to the current one. * * @param b Addend vector * @return Resultant sum of the vectors */ add(b: Vec2D): Vec2D; /** * Subtract a vector from the current one. * * @param b Subtrahend vector * @return Resultant difference of the vectors */ sub(b: Vec2D): Vec2D; /** * Multiply the current vector by a scalar value. * * @param s Scalar value * @return Resultant product */ scale(s: number): Vec2D; /** * Calculate the dot product with another vector. * * @param b Other vector * @return Resultant dot product */ dot(b: Vec2D): number; /** * Get the squared length of the vector. * * @return Squared length */ lengthSq(): number; /** * Get the cartesian length of the vector. * * @return Cartesian length */ length(): number; /** * Get the unit vector. * * @return Directional vector of length 1. */ unit(): Vec2D; /** * Get the array representation of the vector. * * @return Ordered list of coordinate values */ get(): number[]; /** * Grab the string representation of the vector. * * @return Comma-separated values */ toString(): string; /** * Create a new Vec2D object from a comma-separated string. * * @param string Comma-separated values * @return New Vec2D object */ static fromString(string: string): Vec2D; } export { Vec2D };