Mihail Mihaylov wrote: > I want to add a small circle at the end of a line. Whenever I drag the > line, with my mouse or rotate it around, I want the circle to get > updated appropriately and to be at the end of that line. Do you want the circle to be centred upon the line's endpoint, or to be centred on the line and touching the endpoint? Assuming it's the latter, try: Graphics g; int radius; void DrawCircle(int x0, int y0, int x1, int y1) { double vx = x1 - x0; double vy = y1 - y0; double d = Math.sqrt(vx * vx + vy * vy); vx /= d; vy /= d; int x = x1 + radius * vx; int y = y1 + radius * vy; g.drawOval( x - radius, y - radius, radius * 2, radius * 2 ); } > How can I join the newsgroup? Newsgroup? -- Glynn Clements <[EMAIL PROTECTED]>
- calling convention for merging asm&C Tuukka Toivonen
- Re: calling convention for merging asm&C Andrea Arcangeli
- Re: calling convention for merging asm&C Glynn Clements
- Re: calling convention for merging asm&C Andrea Arcangeli
- Re: calling convention for merging asm&a... Glynn Clements
- Re: calling convention for merging ... Andrea Arcangeli
- Re: calling convention for merg... Andrea Arcangeli
- A Geometric Java Problem Mihail Mihaylov
- Re: A Geometric Java Problem James
- Re: A Geometric Java Problem Glynn Clements
- Re: A Geometric Java Problem Mihail Mihaylov
- passing args in regs speed (was:something else) Tuukka Toivonen
- Re: passing args in regs speed (was:somethin... Andrea Arcangeli
- Re: passing args in regs speed (was:somethin... Glynn Clements
- Re: passing args in regs speed (was:somethin... Marc Lehmann
- Re: passing args in regs speed (was:some... Andrea Arcangeli
- Re: calling convention for merging asm&C Glynn Clements
- Re: calling convention for merging asm&C Tuukka Toivonen
- Re: calling convention for merging asm&C Glynn Clements
- Re: calling convention for merging asm&a... Andrea Arcangeli