Hi there. I'm trying to make a speedo/RPM counter, and I'm planning to do it by drawing a line (needle) onto a form, with a dial set as the background. The problem I've come up against however, is trying to draw the line properly.
I have the angle that the line needs to be drawn at, and I have the distance I want it drawn from the centre point. But I can't seem to find any piece of trigonometry that will tell me the points that I will end up drawing to, or even better, something in C# that will be able to draw using an angle, a starting point, and the distance.
I've spent a good bit of time trying to work around it, but any other way ended up being completely inaccurate and/or just didn't do it at all...
EDIT: Solved...
x_edge coordinate = x_center + Math.Cos(u) * radius
y_edge coordinate = y_center - Math.Sin(u) * radius
I have the angle that the line needs to be drawn at, and I have the distance I want it drawn from the centre point. But I can't seem to find any piece of trigonometry that will tell me the points that I will end up drawing to, or even better, something in C# that will be able to draw using an angle, a starting point, and the distance.
I've spent a good bit of time trying to work around it, but any other way ended up being completely inaccurate and/or just didn't do it at all...
EDIT: Solved...
x_edge coordinate = x_center + Math.Cos(u) * radius
y_edge coordinate = y_center - Math.Sin(u) * radius