LogoPixi’VN
pixi-jsFunctions

Function: pointInTriangle()

> pointInTriangle(px, py, x1, y1, x2, y2, x3, y3): boolean

Defined in: node_modules/pixi.js/lib/maths/point/pointInTriangle.d.ts:15

Internal

Check if a point is inside a triangle.

Parameters

px

number

x coordinate of the point

py

number

y coordinate of the point

x1

number

x coordinate of the first vertex of the triangle

y1

number

y coordinate of the first vertex of the triangle

x2

number

x coordinate of the second vertex of the triangle

y2

number

y coordinate of the second vertex of the triangle

x3

number

x coordinate of the third vertex of the triangle

y3

number

y coordinate of the third vertex of the triangle

Returns

boolean

true if the point is inside the triangle, false otherwise