/* @brief 두점을 지나는 원의 중심점을 구한다. @param * psRelMatchPos 원의 중심점 좌표 @param fR 반지름 @param * psCenterPoint 첫번째 점과 두번째 점의 좌표 @param Direction 좌측 또는 우측방향 @return Error code */ ATF_ERR_T CiADAS_ReconstructorDlg ::Get_Two_Point_Circle( AT_FPOINT *psRelMatchPos, const float fR, const AT_FPOINT* psCenterPoint, const BOOL Direction) { float fdx = (psCenterPoint[1].x - psCenterPoint[0].x); float fdy = (psCenterPoint[1].y - psCenterPoint[0].y); float fxc = (psCenterPoint[1].x + psCenterPoint[0].x) / 2.0; float fyc = (psCenterPoint[1].y + psCenterPoint[0].y) / 2.0; float fd = sqrt(fdx * fdx + fdy * fdy); //두점사이의 거리 float fd2 = fd/2; //거리의 중간 float fOffset = sqrt(fR * fR - fd2 * fd2); float fplusx = fOffset * fdy/fd; float fplusy = fOffset * fdx/fd; if(Direction == 1) { psRelMatchPos->x = fxc + fplusx; psRelMatchPos->y = fyc - fplusy; } else// if(Direction == 0) { psRelMatchPos->x = fxc - fplusx; psRelMatchPos->y = fyc + fplusy; } return ATF_ERR_NONE; }
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
7 | ini 파일 이용하기 | makersweb | 2015.07.01 | 7415 |
6 | Visual Studio MFC에서 디버깅용 콘솔 창 띄우기 | pjk | 2014.05.24 | 7927 |
» | 두점을 지나고 반지름을 알고있을 때 원의 중심점을 찾기 | pjk | 2014.06.09 | 7972 |
4 | SetPixel() 을 사용하여 원을 그리기... | pjk | 2014.06.05 | 9687 |
3 | 세 점을 지나는 원 (3 Point Circle) | pjk | 2014.06.05 | 10204 |
2 | 특정 파일이 있는지 확인하는 배치 스크립트 | 운영자 | 2019.04.06 | 10382 |
1 | MFC의 다각형 그리기 | pjk | 2014.05.24 | 15727 |