import * as geom from './index'; import { Shape } from './Shape'; import { Matrix } from './Matrix'; /** * Class representing a vector */ export declare class Vector extends Shape { static EMPTY: Readonly; /** x-coordinate of a vector (float number) */ x: number; /** y-coordinate of a vector (float number) */ y: number; /** * Vector may be constructed by two points, or by two float numbers, * or by array of two numbers */ constructor(a?: unknown, b?: unknown); /** * Method clone returns new instance of Vector */ clone(): geom.Vector; contains(_other: Shape): boolean; get tag(): geom.ShapeTag; get name(): string; get center(): geom.Point; get box(): geom.Box; /** * Slope of the vector in radians from 0 to 2PI */ get slope(): number; /** * Length of vector */ get length(): number; /** * Returns true if vectors are equal up to [DP_TOL]{@link http://localhost:63342/flatten-js/docs/global.html#DP_TOL} * tolerance */ equalTo(v: Vector): boolean; /** * Returns new vector multiplied by scalar */ multiply(scalar: number): geom.Vector; /** * Returns scalar product (dot product) of two vectors
* dot_product = (this * v) */ dot(v: Vector): number; /** * Returns vector product (cross product) of two vectors
* cross_product = (this x v) */ cross(v: Vector): number; /** * Returns unit vector.
* Throw error if given vector has zero length */ normalize(): geom.Vector; /** * Returns new vector rotated by given angle, * positive angle defines rotation in counterclockwise direction, * negative - in clockwise direction * Vector only can be rotated around (0,0) point! * @param angle - Angle in radians */ rotate(angle: number, center?: Readonly): geom.Vector; /** * Return new vector transformed by affine transformation matrix. */ transform(m: Matrix): geom.Vector; /** * Returns vector rotated 90 degrees counterclockwise */ rotate90CW(): geom.Vector; /** * Returns vector rotated 90 degrees clockwise */ rotate90CCW(): geom.Vector; /** * Return inverted vector */ invert(): geom.Vector; /** * Return result of addition of other vector to this vector as a new vector */ add(v: Vector): geom.Vector; /** * Return result of subtraction of other vector from current vector as a new vector */ subtract(v: Vector): geom.Vector; /** * Return angle between this vector and other vector.
* Angle is measured from 0 to 2*PI in the counterclockwise direction * from current vector to another. */ angleTo(v: Vector): number; /** * Return vector projection of the current vector on another vector */ projectionOn(v: Vector): geom.Vector; } /** * Function to create vector equivalent to "new" constructor */ export declare const vector: (a: any, b: any) => geom.Vector; //# sourceMappingURL=Vector.d.ts.map