I have an round shape object in a form, it can be placed in any position. The center of this object is considered 'Center Of Focus', and I know the X,Y coordinates of the center of this object at any time. Let's say it's in position [150,150] of the form.
Now I have another smaller round shape object just outside that main object. I would like to place this other object in a particular location around the main circle, and tell it to go in a certain distance from the center of focus and a certain degree around that center of focus. In other words, I'd like to (eventually) rotate the second object around the main object.
I basically need the following function filled in for me:
Sounds like a Trigonometry formula, but I'm absolutely horrible at mathematics. Any help would be awesome. Thank you!
JD Solutions
Now I have another smaller round shape object just outside that main object. I would like to place this other object in a particular location around the main circle, and tell it to go in a certain distance from the center of focus and a certain degree around that center of focus. In other words, I'd like to (eventually) rotate the second object around the main object.
I basically need the following function filled in for me:
Code:
function PositionAroundPoint(CenterOfFocus: TPoint; DistanceFromFocus: Integer; DegreeAroundFocus: Integer): TPoint;
begin
Result:= CenterOfFocus; //Default result value
//I'm presuming that (CenterOfFocus.Y - DistanceFromFocus) is where it will be placed if I specify 0 Degrees, and (CenterOfFocus.Y + DistanceFromFocus) is where it will be placed if I specify 180 degrees.
//CenterOfFocus = the center static position to base calculation off of
//DistanceFromFocus = how many pixels away from focus
//DegreeAroundFocus = how many degrees around the focus
//Result = Position where second object should be placed
end;
Sounds like a Trigonometry formula, but I'm absolutely horrible at mathematics. Any help would be awesome. Thank you!
JD Solutions