CPP02 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
bsp.cpp ファイル

Implementation of the bsp function to check if a point is inside a triangle. [詳解]

#include "Fixed.hpp"
#include "Point.hpp"
#include <iostream>
bsp.cpp の依存先関係図:

[ソースコード]

関数

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 に定義があります。

関数詳解

◆ bsp()

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.

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.

引数
aThe first vertex of the triangle.
bThe second vertex of the triangle.
cThe third vertex of the triangle.
pointThe point to check if it's inside the triangle.
戻り値
True if the point is strictly inside the triangle, false otherwise.

bsp.cpp51 行目に定義があります。

◆ crossProduct()

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).

This function determines which side of the line formed by points a and b the point c lies on.

引数
aThe starting point of the vectors.
bThe endpoint of the first vector.
cThe endpoint of the second vector.
戻り値
The 2D cross product as a Fixed value.

bsp.cpp35 行目に定義があります。