I have drawn a cirlce and 2 line which intersects the circle using 2D Graphics. Now I want to draw an arc between the intersection point.
The attached pic can show very clearly wht i want. The black portion is drawn. The red part is to be drawn. The radius of arc can vary. But it need to cut the circle at the same point where the line intersects the circle

Attachments
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by gunjannigam

I have drawn a cirlce and 2 line which intersects the circle using 2D Graphics. Now I want to draw an arc between the intersection point.
The attached pic can show very clearly wht i want. The black portion is drawn. The red part is to be drawn. The radius of arc can vary. But it need to cut the circle at the same point where the line intersects the circle

You can use QuadCurve2D to accomplish the task.It takes two end points as input and a control point for deviation.

The syntax is as follows :

``````Graphics2D g;
g.draw(l);``````

x0,y0 is the first point where line intersects circle and x3,y3 is the other point of line intersection.

x2,y2 is the control point that causes deviation.

Edited by Sai Nageswar: n/a

You can use QuadCurve2D to accomplish the task.It takes two end points as input and a control point for deviation.

The syntax is as follows :

``````Graphics2D g;
g.draw(l);``````

x0,y0 is the first point where line intersects circle and x3,y3 is the other point of line intersection.

x2,y2 is the control point that causes deviation.

How do I calculate the control point. I have been given whats the radius of arc. Also do I have perform all the mathematics to calculate the equation of circle and line then find out their intersection point by solving out the quadratic or is there any other way to get the intersection points.The circle is not centered at origin so its gonna be huge calculation otherwise.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.