Bug? Intersection point between ray and circle

classic Classic list List threaded Threaded
6 messages Options
HJH
Reply | Threaded
Open this post in threaded view
|

Bug? Intersection point between ray and circle

HJH
Hello Hilaire

I have the following script. Point A does not show in the result. I wonder if this is a bug.

        | c ptM circle ray ptA |
        c := DrGeoCanvas new.
        ptM := c point: 0 @ 0.
        ptM name: 'M'.
        circle := c circleCenter: ptM radius: 5.
        ray := c ray: ptM to: 5 @ 0.
        ptA := c intersectionOf: ray and: circle.
        ptA name: 'A'.

Intersection between ray and circle

--Hannes
HJH
Reply | Threaded
Open this post in threaded view
|

Re: Bug? Intersection point between ray and circle

HJH
Noteworthy is that if I go for a line instead of a ray it works. But then I have to go for altIntersectionOf:

HJH
Reply | Threaded
Open this post in threaded view
|

Re: Bug? Intersection point between ray and circle

HJH
The case of a line and #intersectionOf:and:

Reply | Threaded
Open this post in threaded view
|

Re: Bug? Intersection point between ray and circle

Hilaire Fernandes
Administrator
In reply to this post by HJH
Hi,

As a matter of fact, you have to use the altInterestctionOf.... because intersectionOf:... will return a point which will never exist, even if you move afterward some items.

Hilaire


Le 19/10/2018 à 16:06, HJH [via Dr. Geo Forum] a écrit :
Hello Hilaire

I have the following script. Point A does not show in the result. I wonder if this is a bug.

        | c ptM circle ray ptA |
        c := DrGeoCanvas new.
        ptM := c point: 0 @ 0.
        ptM name: 'M'.
        circle := c circleCenter: ptM radius: 5.
        ray := c ray: ptM to: 5 @ 0.
        ptA := c intersectionOf: ray and: circle.
        ptA name: 'A'.

Intersection between ray and circle

--Hannes


If you reply to this email, your message will be added to the discussion below:
http://forum.drgeo.eu/Bug-Intersection-point-between-ray-and-circle-tp4025490.html
To start a new topic under Dr. Geo users, email [hidden email]
To unsubscribe from Dr. Geo Forum, click here.
NAML


Was this message helpful?
Tell us!
HJH
Reply | Threaded
Open this post in threaded view
|

Re: Bug? Intersection point between ray and circle

HJH
Yes, #altIntersection:with: works.

But I wonder why #intersection:with: does not catch the point 5@0.

The origin of the ray is 0@0 and then it goes through 5@0.

--Hannes
Reply | Threaded
Open this post in threaded view
|

Re: Bug? Intersection point between ray and circle

Hilaire Fernandes
Administrator
Le 19/10/2018 à 18:16, HJH [via Dr. Geo Forum] a écrit :
> Yes, #altIntersection:with: works.
>
> But I wonder why #intersection:with: does not catch the point 5@0.
>
> The origin of the ray is 0@0 and then it goes through 5@0.
>
> --Hannes


It is because it is a two roots equation.

When writing a script, you don't know in advance which solution you are
interested by.

From the user interface, with the mouse you show Dr. Geo the
intersection point you want, so it can guess which intersection point
you want from the two roots equation.

Hope it clarify.

Hilaire


Was this message helpful?
Tell us!