Thursday, January 20, 2005

Damn my maths is poor!

I used to be pretty hot at maths at school. Took my GCSE a year early, got an A, did A-Level Stats, that sort of thing. I wasn't completely non-numeric. Which was handy, because I'm about as charismatic as a smokestack with the lingual ability of a dead badger.

So back to the point. I'm trying to work out how to calculate the co-ordinates of a point on the circumference of an ellipse. See, I'm trying to neaten up my little dial control. At the moment the hand is drawn by drawing a pie (Graphics.DrawPie) with a sweep angle of 0.001 degrees. Which strikes me as being a bit of a fudge. It also makes it a bit limiting in terms of what I can do with the hands by way of styling etc.

What I'm trying to do instead is calculate the co-ordinates of the outer end of the hand, given the angle that the hand should be at. Doing that for a round control is OK - I can just about remember how to do that from school. And I looked it up somewhere. I'm trying to work out how to get the same thing to work for an ellipse. So if I resize the control so it's not square any more, the hands still look right.

Think I need to get my trusty bit of paper and a pen out. Rest assured, when I work it out I'll be blogging about it.

Just wanted to share.

No comments: