@univerjs/engine-render v0.4.2 • Docs
Class: Vector2
Implements
Constructors
new Vector2()
new Vector2(x, y): Vector2
Creates a new Vector2 from the given x and y coordinates
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
x | number | 0 | defines the first coordinate |
y | number | 0 | defines the second coordinate |
Returns
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:33 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Description | Defined in |
---|---|---|---|---|---|
x | public | number | 0 | defines the first coordinate | submodules/univer/packages/engine-render/src/basics/vector2.ts:35 (opens in a new tab) |
y | public | number | 0 | defines the second coordinate | submodules/univer/packages/engine-render/src/basics/vector2.ts:37 (opens in a new tab) |
Methods
add()
add(otherVector): Vector2
Add another vector with the current one
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
Returns
a new Vector2 set with the addition of the current Vector2 and the given one coordinates
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:505 (opens in a new tab)
addByPoint()
addByPoint(x, y): Vector2
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:521 (opens in a new tab)
addInPlace()
addInPlace(otherVector): Vector2
Set the Vector2 coordinates by adding the given Vector2 coordinates
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:530 (opens in a new tab)
addToRef()
addToRef(otherVector, result): Vector2
Sets the "result" coordinates with the addition of the current Vector2 and the given one coordinates
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
result | Vector2 | defines the target vector |
Returns
the unmodified current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:515 (opens in a new tab)
asArray()
asArray(): number[]
Copy the current vector to an array
Returns
number
[]
a new array with 2 elements: the Vector2 coordinates.
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:461 (opens in a new tab)
clone()
clone(): Vector2
Gets a new Vector2 copied from the Vector2
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:828 (opens in a new tab)
copyFrom()
copyFrom(source): Vector2
Sets the Vector2 coordinates with the given Vector2 coordinates
Parameters
Parameter | Type | Description |
---|---|---|
source | DeepImmutableObject <Vector2 > | defines the source Vector2 |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:472 (opens in a new tab)
copyFromFloats()
copyFromFloats(x, y): Vector2
Sets the Vector2 coordinates with the given floats
Parameters
Parameter | Type | Description |
---|---|---|
x | number | defines the first coordinate |
y | number | defines the second coordinate |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:484 (opens in a new tab)
divide()
divide(otherVector): Vector2
Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | Vector2 | defines the other vector |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:619 (opens in a new tab)
divideInPlace()
divideInPlace(otherVector): Vector2
Divides the current Vector2 coordinates by the given ones
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:640 (opens in a new tab)
divideToRef()
divideToRef(otherVector, result): Vector2
Sets the "result" coordinates with the Vector2 divided by the given one coordinates
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
result | Vector2 | defines the target vector |
Returns
the unmodified current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:629 (opens in a new tab)
equals()
equals(otherVector): boolean
Gets a boolean if two vectors are equals
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
Returns
boolean
true if the given vector coordinates strictly equal the current Vector2 ones
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:722 (opens in a new tab)
floor()
floor(): Vector2
Gets a new Vector2 from current Vector2 floored values eg (1.2, 2.31) returns (1, 2)
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:731 (opens in a new tab)
fract()
fract(): Vector2
Gets a new Vector2 from current Vector2 fractional values eg (1.2, 2.31) returns (0.2, 0.31)
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:740 (opens in a new tab)
fromArray()
fromArray(array, index): Vector2
Update the current vector from an array
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
array | FloatArray | undefined | defines the destination array |
index | number | 0 | defines the offset in the destination array |
Returns
the current Vector3
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:452 (opens in a new tab)
getClassName()
getClassName(): string
Gets class name
Returns
string
the string "Vector2"
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:418 (opens in a new tab)
getHashCode()
getHashCode(): number
Gets current vector hash code
Returns
number
the Vector2 hash code as a number
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:426 (opens in a new tab)
length()
length(): number
Gets the length of the vector
Returns
number
the vector length (float)
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:801 (opens in a new tab)
lengthSquared()
lengthSquared(): number
Gets the vector squared length
Returns
number
the vector squared length (float)
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:809 (opens in a new tab)
multiply()
multiply(otherVector): Vector2
Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:588 (opens in a new tab)
multiplyByFloats()
multiplyByFloats(x, y): Vector2
Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats
Parameters
Parameter | Type | Description |
---|---|---|
x | number | defines the first coordinate |
y | number | defines the second coordinate |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:610 (opens in a new tab)
multiplyInPlace()
multiplyInPlace(otherVector): Vector2
Multiplies in place the current Vector2 coordinates by the given ones
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:577 (opens in a new tab)
multiplyToRef()
multiplyToRef(otherVector, result): Vector2
Sets "result" coordinates with the multiplication of the current Vector2 and the given one coordinates
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
result | Vector2 | defines the target vector |
Returns
the unmodified current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:598 (opens in a new tab)
negate()
negate(): Vector2
Gets a new Vector2 with current Vector2 negated coordinates
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:648 (opens in a new tab)
negateInPlace()
negateInPlace(): Vector2
Negate this vector in place
Returns
this
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:656 (opens in a new tab)
negateToRef()
negateToRef(result): Vector2
Negate the current Vector2 and stores the result in the given vector "result" coordinates
Parameters
Parameter | Type | Description |
---|---|---|
result | Vector2 | defines the Vector3 object where to store the result |
Returns
the current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:667 (opens in a new tab)
normalize()
normalize(): Vector2
Normalize the vector
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:819 (opens in a new tab)
rotate()
rotate(angle): Vector2
Rotate the current vector into a given result vector
Parameters
Parameter | Type | Description |
---|---|---|
angle | number | defines the rotation angle |
Returns
the current vector
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:749 (opens in a new tab)
rotateByPoint()
rotateByPoint(angle, originPoint): Vector2
Parameters
Parameter | Type |
---|---|
angle | number |
originPoint | Vector2 |
Returns
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:774 (opens in a new tab)
rotateToRef()
rotateToRef(angle, result): Vector2
Rotate the current vector into a given result vector
Parameters
Parameter | Type | Description |
---|---|---|
angle | number | defines the rotation angle |
result | Vector2 | defines the result vector where to store the rotated vector |
Returns
the current vector
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:765 (opens in a new tab)
scale()
scale(scale): Vector2
Returns a new Vector2 scaled by "scale" from the current Vector2
Parameters
Parameter | Type | Description |
---|---|---|
scale | number | defines the scaling factor |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:687 (opens in a new tab)
scaleAndAddToRef()
scaleAndAddToRef(scale, result): Vector2
Scale the current Vector2 values by a factor and add the result to a given Vector2
Parameters
Parameter | Type | Description |
---|---|---|
scale | number | defines the scale factor |
result | Vector2 | defines the Vector2 object where to store the result |
Returns
the unmodified current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:711 (opens in a new tab)
scaleInPlace()
scaleInPlace(scale): Vector2
Multiply the Vector2 coordinates by scale
Parameters
Parameter | Type | Description |
---|---|---|
scale | number | defines the scaling factor |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:676 (opens in a new tab)
scaleToRef()
scaleToRef(scale, result): Vector2
Scale the current Vector2 values by a factor to a given Vector2
Parameters
Parameter | Type | Description |
---|---|---|
scale | number | defines the scale factor |
result | Vector2 | defines the Vector2 object where to store the result |
Returns
the unmodified current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:699 (opens in a new tab)
set()
set(x, y): Vector2
Sets the Vector2 coordinates with the given floats
Parameters
Parameter | Type | Description |
---|---|---|
x | number | defines the first coordinate |
y | number | defines the second coordinate |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:496 (opens in a new tab)
subtract()
subtract(otherVector): Vector2
Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | Vector2 | defines the other vector |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:541 (opens in a new tab)
subtractByPoint()
subtractByPoint(x, y): Vector2
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:545 (opens in a new tab)
subtractInPlace()
subtractInPlace(otherVector): Vector2
Sets the current Vector2 coordinates by subtracting from it the given one coordinates
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
Returns
the current updated Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:566 (opens in a new tab)
subtractToRef()
subtractToRef(otherVector, result): Vector2
Sets the "result" coordinates with the subtraction of the given one from the current Vector2 coordinates.
Parameters
Parameter | Type | Description |
---|---|---|
otherVector | DeepImmutableObject <Vector2 > | defines the other vector |
result | Vector2 | defines the target vector |
Returns
the unmodified current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:555 (opens in a new tab)
toArray()
toArray(array, index): Vector2
Sets the Vector2 coordinates in the given array or Float32Array from the given index.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
array | FloatArray | undefined | defines the source array |
index | number | 0 | defines the offset in source array |
Returns
the current Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:440 (opens in a new tab)
toString()
toString(): string
Gets a string with the Vector2 coordinates
Returns
string
a string with the Vector2 coordinates
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:410 (opens in a new tab)
transformCoordinateOnRotate()
transformCoordinateOnRotate(angle): Vector2
Parameters
Parameter | Type |
---|---|
angle | number |
Returns
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:786 (opens in a new tab)
CatmullRom()
static CatmullRom(
value1,
value2,
value3,
value4,
amount): Vector2
Gets a new Vector2 located for "amount" (float) on the CatmullRom spline defined by the given four Vector2
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines 1st point of control |
value2 | DeepImmutableObject <Vector2 > | defines 2nd point of control |
value3 | DeepImmutableObject <Vector2 > | defines 3rd point of control |
value4 | DeepImmutableObject <Vector2 > | defines 4th point of control |
amount | number | defines the interpolation factor |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:90 (opens in a new tab)
Center()
static Center(value1, value2): Vector2
Gets a new Vector2 located at the center of the vectors "value1" and "value2"
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines first vector |
value2 | DeepImmutableObject <Vector2 > | defines second vector |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:361 (opens in a new tab)
CenterToRef()
static CenterToRef(
value1,
value2,
ref): Vector2
Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines first vector |
value2 | DeepImmutableObject <Vector2 > | defines second vector |
ref | DeepImmutableObject <Vector2 > | defines third vector |
Returns
ref
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:372 (opens in a new tab)
Clamp()
static Clamp(
value,
min,
max): Vector2
Returns a new Vector2 set with same the coordinates than "value" ones if the vector "value" is in the square defined by "min" and "max". If a coordinate of "value" is lower than "min" coordinates, the returned Vector2 is given this "min" coordinate. If a coordinate of "value" is greater than "max" coordinates, the returned Vector2 is given this "max" coordinate
Parameters
Parameter | Type | Description |
---|---|---|
value | DeepImmutableObject <Vector2 > | defines the value to clamp |
min | DeepImmutableObject <Vector2 > | defines the lower limit |
max | DeepImmutableObject <Vector2 > | defines the upper limit |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:126 (opens in a new tab)
Distance()
static Distance(value1, value2): number
Gets the distance between the vectors "value1" and "value2"
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines first vector |
value2 | DeepImmutableObject <Vector2 > | defines second vector |
Returns
number
the distance between vectors
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:339 (opens in a new tab)
DistanceOfPointFromSegment()
static DistanceOfPointFromSegment(
p,
segA,
segB): number
Gets the shortest distance (float) between the point "p" and the segment defined by the two points "segA" and "segB".
Parameters
Parameter | Type | Description |
---|---|---|
p | DeepImmutableObject <Vector2 > | defines the middle point |
segA | DeepImmutableObject <Vector2 > | defines one point of the segment |
segB | DeepImmutableObject <Vector2 > | defines the other point of the segment |
Returns
number
the shortest distance
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:387 (opens in a new tab)
DistanceSquared()
static DistanceSquared(value1, value2): number
Returns the squared distance between the vectors "value1" and "value2"
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines first vector |
value2 | DeepImmutableObject <Vector2 > | defines second vector |
Returns
number
the squared distance between vectors
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:349 (opens in a new tab)
Dot()
static Dot(left, right): number
Gets the dot product of the vector "left" and the vector "right"
Parameters
Parameter | Type | Description |
---|---|---|
left | DeepImmutableObject <Vector2 > | defines first vector |
right | DeepImmutableObject <Vector2 > | defines second vector |
Returns
number
the dot product (float)
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:240 (opens in a new tab)
FromArray()
static FromArray(array, offset): Vector2
Gets a new Vector2 set from the given index element of the given array
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
array | DeepImmutableObject <ArrayLike <number >> | undefined | defines the data source |
offset | number | 0 | defines the offset in the data source |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:66 (opens in a new tab)
FromArrayToRef()
static FromArrayToRef(
array,
offset,
result): void
Sets "result" from the given index element of the given array
Parameters
Parameter | Type | Description |
---|---|---|
array | ArrayLike <number > | defines the data source |
offset | number | defines the offset in the data source |
result | Vector2 | defines the target vector |
Returns
void
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:76 (opens in a new tab)
Hermite()
static Hermite(
value1,
tangent1,
value2,
tangent2,
amount): Vector2
Returns a new Vector2 located for "amount" (float) on the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2"
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines the 1st control point |
tangent1 | DeepImmutableObject <Vector2 > | defines the outgoing tangent |
value2 | DeepImmutableObject <Vector2 > | defines the 2nd control point |
tangent2 | DeepImmutableObject <Vector2 > | defines the incoming tangent |
amount | number | defines the interpolation factor |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:147 (opens in a new tab)
Hermite1stDerivative()
static Hermite1stDerivative(
value1,
tangent1,
value2,
tangent2,
time): Vector2
Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines the first control point |
tangent1 | DeepImmutableObject <Vector2 > | defines the first tangent |
value2 | DeepImmutableObject <Vector2 > | defines the second control point |
tangent2 | DeepImmutableObject <Vector2 > | defines the second tangent |
time | number | define where the derivative must be done |
Returns
1st derivative
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:176 (opens in a new tab)
Hermite1stDerivativeToRef()
static Hermite1stDerivativeToRef(
value1,
tangent1,
value2,
tangent2,
time,
result): void
Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
Parameters
Parameter | Type | Description |
---|---|---|
value1 | DeepImmutableObject <Vector2 > | defines the first control point |
tangent1 | DeepImmutableObject <Vector2 > | defines the first tangent |
value2 | DeepImmutableObject <Vector2 > | defines the second control point |
tangent2 | DeepImmutableObject <Vector2 > | defines the second tangent |
time | number | define where the derivative must be done |
result | Vector2 | define where the derivative will be stored |
Returns
void
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:199 (opens in a new tab)
Lerp()
static Lerp(
start,
end,
amount): Vector2
Returns a new Vector2 located for "amount" (float) on the linear interpolation between the vector "start" adn the vector "end".
Parameters
Parameter | Type | Description |
---|---|---|
start | DeepImmutableObject <Vector2 > | defines the start vector |
end | DeepImmutableObject <Vector2 > | defines the end vector |
amount | number | defines the interpolation factor |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:228 (opens in a new tab)
Maximize()
static Maximize(left, right): Vector2
Gets a new Vector2 set with the maximal coordinate values from the "left" and "right" vectors
Parameters
Parameter | Type | Description |
---|---|---|
left | DeepImmutableObject <Vector2 > | defines 1st vector |
right | DeepImmutableObject <Vector2 > | defines 2nd vector |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:289 (opens in a new tab)
Minimize()
static Minimize(left, right): Vector2
Gets a new Vector2 set with the minimal coordinate values from the "left" and "right" vectors
Parameters
Parameter | Type | Description |
---|---|---|
left | DeepImmutableObject <Vector2 > | defines 1st vector |
right | DeepImmutableObject <Vector2 > | defines 2nd vector |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:277 (opens in a new tab)
Normalize()
static Normalize(vector): Vector2
Returns a new Vector2 equal to the normalized given vector
Parameters
Parameter | Type | Description |
---|---|---|
vector | DeepImmutableObject <Vector2 > | defines the vector to normalize |
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:249 (opens in a new tab)
NormalizeToRef()
static NormalizeToRef(vector, result): void
Normalize a given vector into a second one
Parameters
Parameter | Type | Description |
---|---|---|
vector | DeepImmutableObject <Vector2 > | defines the vector to normalize |
result | Vector2 | defines the vector where to store the result |
Returns
void
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:260 (opens in a new tab)
One()
static One(): Vector2
Gets a new Vector2(1, 1)
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:56 (opens in a new tab)
PointInTriangle()
static PointInTriangle(
p,
p0,
p1,
p2): boolean
Determines if a given vector is included in a triangle
Parameters
Parameter | Type | Description |
---|---|---|
p | DeepImmutableObject <Vector2 > | defines the vector to test |
p0 | DeepImmutableObject <Vector2 > | defines 1st triangle point |
p1 | DeepImmutableObject <Vector2 > | defines 2nd triangle point |
p2 | DeepImmutableObject <Vector2 > | defines 3rd triangle point |
Returns
boolean
true if the point "p" is in the triangle defined by the vectors "p0", "p1", "p2"
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:319 (opens in a new tab)
Zero()
static Zero(): Vector2
Gets a new Vector2(0, 0)
Returns
a new Vector2
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:48 (opens in a new tab)
create()
static create(x, y): Vector2
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
Defined in
submodules/univer/packages/engine-render/src/basics/vector2.ts:402 (opens in a new tab)