CPP02 1.0
|
Implementation of the bsp function to check if a point is inside a triangle. [詳解]
関数 | |
Fixed | crossProduct (const Point &a, const Point &b, const Point &c) |
Helper function to calculate the 2D cross product of vectors (b-a) and (c-a). | |
bool | bsp (Point const a, Point const b, Point const c, Point const point) |
Determines if a point is strictly inside a triangle defined by three other points. | |
Implementation of the bsp function to check if a point is inside a triangle.
This file defines the bsp function, which uses the cross product to determine if a given point lies strictly inside a triangle defined by three vertices. It also includes a helper function to calculate the 2D cross product.
bsp.cpp に定義があります。
Determines if a point is strictly inside a triangle defined by three other points.
The point is inside if it lies on the same side of each of the three lines formed by the triangle's edges. Points on the edges or vertices are considered outside.
a | The first vertex of the triangle. |
b | The second vertex of the triangle. |
c | The third vertex of the triangle. |
point | The point to check if it's inside the triangle. |
Helper function to calculate the 2D cross product of vectors (b-a) and (c-a).
This function determines which side of the line formed by points a and b the point c lies on.
a | The starting point of the vectors. |
b | The endpoint of the first vector. |
c | The endpoint of the second vector. |