Skip to content

@simversus/yjvisDocs


@simversus/yjvis / Vec2

Class: Vec2

Constructors

new Vec2()

new Vec2(x, y): Vec2

Parameters

x: number = 0

y: number = x

Returns

Vec2

Defined in

math/vec2.ts:6

Properties

elements

elements: [number, number]

Defined in

math/vec2.ts:4

Accessors

0

get 0(): number

set 0(v): void

Parameters

v: number

Returns

number

Defined in

math/vec2.ts:26


1

get 1(): number

set 1(v): void

Parameters

v: number

Returns

number

Defined in

math/vec2.ts:30


x

get x(): number

set x(v): void

Parameters

v: number

Returns

number

Defined in

math/vec2.ts:10


y

get y(): number

set y(v): void

Parameters

v: number

Returns

number

Defined in

math/vec2.ts:14

Methods

distance()

distance(v): number

两个向量的距离

Parameters

v: Vec2

Returns

number

Defined in

math/vec2.ts:53


set()

set(x, y): Vec2

Parameters

x: number | [number, number, number]

y: number | [number, number, number] = x

Returns

Vec2

Defined in

math/vec2.ts:42