Class: vec2
二维向量计算
Table of contents
Constructors
Properties
Constructors
constructor
new vec2()
Properties
add
Static
add: (out
: Vec2
, v1
: Vec2
, v2
: Vec2
) => Vec2
= add
Type declaration
(out
, v1
, v2
): Vec2
Parameters
Name | Type |
---|---|
out | Vec2 |
v1 | Vec2 |
v2 | Vec2 |
Returns
dot
Static
dot: (v1
: Vec2
, v2
: Vec2
) => number
= dot
Type declaration
(v1
, v2
): number
Parameters
Name | Type |
---|---|
v1 | Vec2 |
v2 | Vec2 |
Returns
number
len
Static
len: (v
: Vec2
) => number
= len
Type declaration
(v
): number
Parameters
Name | Type |
---|---|
v | Vec2 |
Returns
number
multiplyC
Static
multiplyC: (out
: Vec2
, v1
: Vec2
, c
: number
) => Vec2
= multiplyC
Type declaration
(out
, v1
, c
): Vec2
Parameters
Name | Type |
---|---|
out | Vec2 |
v1 | Vec2 |
c | number |
Returns
negate
Static
negate: (out
: Vec2
, a
: Vec2
) => Vec2
= negate
Type declaration
(out
, a
): Vec2
Parameters
Name | Type |
---|---|
out | Vec2 |
a | Vec2 |
Returns
normalize
Static
normalize: (out
: number
[], v
: any
) => Vec2
= normalize
Type declaration
(out
, v
): Vec2
Parameters
Name | Type |
---|---|
out | number [] |
v | any |
Returns
projection
Static
projection: (out
: Vec2
, v
: Vec2
, n
: Vec2
) => Vec2
= projection
Type declaration
(out
, v
, n
): Vec2
Parameters
Name | Type |
---|---|
out | Vec2 |
v | Vec2 |
n | Vec2 |
Returns
scale
Static
scale: (out
: any
, v
: any
, s
: number
) => Vec2
= scale
Type declaration
(out
, v
, s
): Vec2
Parameters
Name | Type |
---|---|
out | any |
v | any |
s | number |