Amit Saha
unread,Mar 30, 2014, 5:09:58 AM3/30/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
Hello,
Consider the following program:
"""
Draw a line given two points it passes through
"""
from sympy import Point, Line, plot_implicit
def draw_line(x1, y1, x2, y2):
p1 = Point(x1, y1)
p2 = Point(x2, y2)
l = Line(p1, p2)
eqn = l.equation()
print(eqn)
plot_implicit(eqn)
if __name__=='__main__':
x1, y1 = -1, 0
x2, y2 = 2, 3
draw_line(x1, y1, x2, y2)
Basically, I am creating a line object passing through (-1,0) and
(2,3). When I use plot_implicit() to draw the this line, it randomly
draws a line passing through (0, -1) and (3,2) instead about 40% of
the times.
What could be happening here?
Thanks for any hints.
Best,
Amit.