유클리드 거리 공식
float GetDistance(const FVector2D& FirstLocation, const FVector2D& SecondLocation)
{
float DeltaX = SecondLocation.X - FirstLocation.X;
float DeltaY = SecondLocation.Y - FirstLocation.Y;
return FMath::Sqrt((DeltaX * DeltaX) + (DeltaY * DeltaY));
}
'내배캠 > C++' 카테고리의 다른 글
friend class (0) | 2025.01.07 |
---|---|
Linked List 클래스로 구현 (0) | 2025.01.07 |
priority_queue (1) | 2025.01.06 |
std::vector를 class로 구현 (1) | 2024.12.31 |
std::regex_replace (0) | 2024.12.31 |