Hi all,
I have this two line
l1=Line(Point(2.0, 2.0), Point(0.0,10.0))
l2=Line(Point(0.0, 1.0), Point(8.0,3.0))
I try to get the intersection point with this method:
l1.intersection(l2)
it return a []
I do some debug on the intersection function and I see that the inter in o
is false
Some code of the def intersection(self, o): function ..
...
...
if (inter in self) and (inter in o):
return [inter]
....
I can't found the point where the code check for inter in o ..
The two line are not parallel so an intersection is possible ..
Regards,
Matteo
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Vinzent Steinberg
Sent: 31 May 2010 00:01
To: sympy
Subject: [sympy] Re: Pythoncad & sympy.geometry
On 29 Mai, 08:13, "Matteo Boscolo" <[email protected]>
wrote:
> Hi Michael,>If you mean construct a line tangent to a circle given a point
on the line
>
> that is not on the circle, then no>there isn't because that gives multiple
solutions
>
> Yes I know.. but intersecting a line with a circle give multiple solution
> too ..
>
> In case of a point out of a circle we get 2 tangent Line and it's easy to
> calculate ..
> If you get the Polar Line referred at the circle
> p:xX+yY+a(X+x)/2+b(Y+y)/2+c=0
> Where (x,y) are the external point and x^2+y^2+ax+by+c=0 is the circle
> equation.
> Intersect the Polarline with the circle and you get the intersection
> points..
>
> There is any easy way to compute this with sympy?
> Regards,
> Matteo
See
http://docs.sympy.org/modules/geometry.html
for and the docstrings of the functions and classes to see what is
possible.
The docstrings should be included in the html docs BTW.
I guess you would need to improve the algorithm to accept points
outside the circle. (There is also the problem that there are 2
solutions then.)
Vinzent
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.