Bresenham (2) 썸네일형 리스트형 Bresenham's algorithm 한국어 버전 보기 Bresenham's algorithm is an algorithm designed to draw straight lines only by counting integers, excluding real number calculations that make complex and slow calculations in computer graphics. The coordinates calculated using the formula of a straight line are rounded off or rounded to an integer in order to be displayed on the screen. Let's take a look at the process of converting th.. 브레즌햄(Bresenham) 알고리즘 브레즌햄 알고리즘은 컴퓨터 그래픽스에서 복잡하고 계산을 느리게 만드는 실수 계산을 배제하고 정수 계산만으로 직선을 그리기 위해 만들어진 알고리즘 입니다. 직선의 공식을 이용해 계산된 좌표값은 결국 스크린에 표현하기 위해서는 소수점 이하를 버림한다던지 반올림 해서 정수로 만들게 됩니다. 이렇게 버려지는 소수점 이하의 복잡한 계산을 브레즌햄 공식을 이용하여 간단한 정수 연산으로 바꾸는 과정을 알아보도록 하겠습니다. 먼저 두 점을 지나는 직선의 방정식을 보면 아래와 같습니다 : y - y1 = (x2 - x1) / (y2 - y1) * (x - x1) y = (x2 - x1)/(y2 - y1) * (x - x1) + y1 예를 들어 (2, 1) 과 (6, 4)를 지나는 직선의 점들 중 x가 3일때 y의 값은 .. 이전 1 다음