Circle geometry
-
Boy! I wish I paid attention in maths class instead of reading Visual Basic Programmer's Journal! (yeh right!) Can any kind soul give me a function which returns a Point object, where the point is a set number of degrees around a circle which fits inside a given rectangle. I know that's an odd way to describe it! Dim lRect As Rectangle = new Rectangle(0,0,100,100) Dim lPoint1 As Point = PointOnCircle(lRect,45) Dim lPoint2 As Point = PointOnCircle(lRect,135) The above two calls will acquire Points where the X,Y coordinates are at 45 degrees around the circle (which fits in a rectangle of 100,100) and 135 degrees respectively. The bit that gets me is the X= some sin/cos nonsense and Y= the other bit (and those bl**dy radians are involved aren't they). Maybe I did keep one eye on the blackboard. I would be prepared to have your babies if you can pull this one off for me (which I am just sure you are dying to know how I will manage that!). Thanks! Ps: Sorry for all the !!! in here, well it is New Year and all that!! oops! damn! can't stop it! Nursey
-
Boy! I wish I paid attention in maths class instead of reading Visual Basic Programmer's Journal! (yeh right!) Can any kind soul give me a function which returns a Point object, where the point is a set number of degrees around a circle which fits inside a given rectangle. I know that's an odd way to describe it! Dim lRect As Rectangle = new Rectangle(0,0,100,100) Dim lPoint1 As Point = PointOnCircle(lRect,45) Dim lPoint2 As Point = PointOnCircle(lRect,135) The above two calls will acquire Points where the X,Y coordinates are at 45 degrees around the circle (which fits in a rectangle of 100,100) and 135 degrees respectively. The bit that gets me is the X= some sin/cos nonsense and Y= the other bit (and those bl**dy radians are involved aren't they). Maybe I did keep one eye on the blackboard. I would be prepared to have your babies if you can pull this one off for me (which I am just sure you are dying to know how I will manage that!). Thanks! Ps: Sorry for all the !!! in here, well it is New Year and all that!! oops! damn! can't stop it! Nursey
Jeez you guys must be peeing laughing at my math abilities 8-) I found this website for nuclear physics (OK its an explanation of trig for 2 year olds) http://www.updatestage.com/previous/991001.html If anybody would like the code for building a polygon of any number of sides that fits in a specified box/circle, then let me know. Nursey