0

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

Not Yet Answered # Grraphics Help

Sai Nageswar Discussion Starter gunjannigam 28

0

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

0

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;
QuadCurve2D.Double l = new QuadCurve2D.Double(x0,y0,x1,y1,x2,y2);
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 7 Years Ago by Sai Nageswar*: n/a

0

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; QuadCurve2D.Double l = new QuadCurve2D.Double(x0,y0,x1,y1,x2,y2); 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 article has been dead for over six months. Start a new discussion instead.

Recommended Articles

I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...

```
#include <stdio.h>
int main(void)
int movieChoice;
int seatNum;
int seatPlan[5][10] = { 0 };
int rows, cols;
char space;
void seatDisplay(int a[][10]);
void seatNew(int n[][10]);
void seatDisplay(int a[][10]) { //this function shows the seat plan
for (int i = 0; i<5; i++) {
for (int j = 0; j<10; j++) ...
```

I have this tree format.

```
> myapp->
> setup.py
> tests ->
> test_myapp.py
> myapp ->
> __init__.py
> myapp.py
```

And from test_myapp.py, I am calling: `from myapp import myapp`

and when I run`python setup.py test`

I am getting `No module named 'myapp'`