Answer the question
In order to leave comments, you need to log in
Pascal. Why doesn't the straight line and the circle do not intersect? For values 1 1 2?
Use crt;
var a,r0,b,x0,y0,x1,y1:real;
begin
writeln('Enter value a');
readln(a);
writeln('Enter value r0(radius of circle');
readln(r0);
writeln('Enter value b');
readln(b);
x0:=-((sqrt((sqr(a)+1)*sqr( r0)-sqr(b))+(a*b))/(a*a+1));
y0:=((ba)*sqrt((sqr(a)+1)*sqr(r0)-sqr (b)))/(sqr(a)+1);
x1:=((sqrt((sqr(a)+1)*sqr(r0)-sqr(b))-(a*b))/( a*a+1));
y1:=(a*sqrt((sqr(a)+1)*sqr(r0)-sqr(b))+b)/(a*a+1);
if (sqrt (sqr(a)+1*sqr(r0)-sqr(b)) >= 0) then
begin
writeln('First x and y intersection point');
writeln(x0);
writeln(y0);
writeln('Second point of intersection with x and y coordinates');
writeln(x1);
writeln(y1);
end
else
begin
writeln('Line and circle do not intersect or conditions are not met');
end;
if (sqrt(sqr(a)+1*sqr(r0)-sqr(b)) >= 0) and (x0=x1) and (y0=y1)
then
begin
writeln('Point of intersection with x and y coordinates' );
writeln(x0);
writeln(y0);
end
end.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question