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