Hi everybody,
I am a programmer, but unfortunately I am not very good in Geometry and I
have the following problem:
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.
Example:
Start point End point
and the circle
|
| |
| |
V V
-------------------------------------o
(something like that)
I am writing that code in Java 1.1 ( I hope noone gets offended) and it's
almost ready, except for that little smart calculation part, where I have
to find out where exactly to draw the circle, based on the coordinates
of the edge's start and end points, which are passed to me, everytime
the edge (line) is moved or rotated. To make things even more
interesting, in Java the function for drawing circles has the following
prototype:
drawOval(int x, int y, int width, int height)
where:
these coordinates specify a rectangle, in which my circle (ellipse)
should fit.
I am really confused about how to choose that x,y point, that I should
pass to the above function, based on the start,end point coordinates of
the line.
Thank you. Please Help.
Sincerely
mich
P.S.
How can I join the newsgroup?