문제

WinForms 응용 프로그램에는 작은 차트가 있습니다. 내가 선과 연결하는 x/y 포인트의 무리 만 공상하는 것은 없습니다.

이 점들을 연결하기 위해 선 대신 곡선을 그리는 것이 좋을 것입니다. 그러나 수학은 결코 내 강한면이 아니었기 때문에 어떻게 해야할지 전혀 모른다.

모든 종류의 샘플이나 조언은 도움이 될 것입니다.

도움이 되었습니까?

해결책

This is very simple - no need for any math - just use Graphics.DrawCurve instead of DrawPolygon/DrawLine (see the very good help on this function).

다른 팁

Apologies for the thread resurrection, but I had to reply to this one:

Be clear in your mind what you want to achieve. I don't know the details of your project, but the methods being suggested are not appropriate for many applications. The correct solution depends on whether you intend the curves you're drawing to simply look nice, or to represent meaningful data. For the former, drawing a bezier curve is fine, but they are not mathematically meaningful and if you're trying to draw a graph to be interpreted with scientific rigour, they will mislead the user. For many applications what you'd want is a best-fit line. These have clear functional form, for example, a degree-2 polynomial (otherwise known as a parabola), a logarithmic curve, or a moving-average. All these are present in Excel and all have specific applications and are emphatically the wrong choice for anything outside their specific remit. The topic of statistical analysis of data is probably beyond the scope of a StackOverflow post - but to start with, look up 'linear regression', what you're describing is comprehensively dealt with by this area of mathematics.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top