Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## foxgui-users

 Re: [Foxgui-users] Drawing circles From: JVZ - 2012-07-11 17:31:33 ```On Wed, 11 Jul 2012 17:22:20 +0100 (BST) Cakir Ahmet wrote: > Hi > > Sorry to bother you again > > However I have a little problem > > The way that I try to do the arrows do not work for when I use drawArc since I do not really know where is the end of the arc > > And I tried to do it the other way. What I mean is that for example if between two nodes A (100,100) and B(200,200) from A to B, I need to draw an arc , I tried to start at 200,200 so that I would know where to put the arrow part. > > But when I did that way, I could not get the perfectly between them since I did not really understand how the arc is drawn. > > So I was wondering if you could give me a brief explanation pls > > Thank you very much and sorry to disturb you with my questions OK, I'm afraid some math is required, but here it goes: drawArc, fillArc, fillChord, drawArcs(), etc. all use similar logic, so what I will say applies to all of them. Imagine the arc (actually, oval) inscribed in a box: x | y-+-------------------+ | | | | | |h | | | | +-------------------+ w The center of the oval is thus x+w/2, y+h/2. Each point on the oval is found as x+w/2+w*cos(phi)/2, y+h/2-h*sin(phi)/2. The angle phi, in radians, runs from ang1*PI/11520 to (ang1+ang2)*PI/11520, counter clockwise for positive numbers. Thus, the call dc.drawArc(20,120,100,100,64*ang1,64*ang2) draws an arc from ang1 to ang1+ang2 ccw, with center x=20+100/2=70 and y=120+100/2=170 and with radius 100/2. Hope this helps, -- JVZ +----------------------------------------------------------------------------+ | Copyright (C) 11:50 07/11/2012 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ ```