Amit Saha
unread,May 3, 2014, 5:39:34 AM5/3/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
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 all,
Consider the program below which is an attempt to prove that the angle
inscribed at the center by any two points on a circle is always twice
the angle inscribed on the circumference:
from sympy import Circle, Point, Segment
def prove_theorem():
c = Point(0, 0)
c1 = Circle(c, 2)
p = c1.random_point()
q = c1.random_point()
r = c1.random_point()
pc = Segment(p, c)
qc = Segment(q, c)
pcq = pc.angle_between(qc)
pr = Segment(p, r)
qr = Segment(q, r)
prq = pr.angle_between(qr)
print((pcq/prq).evalf())
if __name__=='__main__':
for _ in range(100):
prove_theorem()
The result which should always be 2.00 theoretically ranges from
0.533910696827908 to 26.3044198350215.
The only source of this randomness seems to be the random_point()
method. But, is such a huge variance expected? Is there a way to
minimize this variance?
Thanks for any hints.
Best,
Amit.