Comment #5 on issue 3108 by smi...@gmail.com: wrong code in
Polygon.arbitrary_point
http://code.google.com/p/sympy/issues/detail?id=3108
Seems to work with symbolic values:
tri=Polygon((0, 0), (1, 0), (1, a))
var('t', real=True)
t
p = tri.arbitrary_point('t')
perimeter = tri.perimeter
s1, s2 = [s.length for s in tri.sides[:2]]
p.subs(t, (s1 + s2/2)/perimeter)
Piecewise((Point(sqrt(a**2)/2 + 1, 0), (sqrt(a**2)/2 + 1)/(sqrt(a**2 + 1) +
sqrt
(a**2) + 1) < 1/(sqrt(a**2 + 1) + sqrt(a**2) + 1)), (Point(1,
a*((sqrt(a**2)/2 +
1)/(sqrt(a**2 + 1) + sqrt(a**2) + 1) - 1/(sqrt(a**2 + 1) + sqrt(a**2) +
1))*(sq
rt(a**2 + 1) + sqrt(a**2) + 1)/sqrt(a**2)), 1/(sqrt(a**2 + 1) + sqrt(a**2)
+ 1)
<= (sqrt(a**2)/2 + 1)/(sqrt(a**2 + 1) + sqrt(a**2) + 1)),
(Point(((sqrt(a**2)/2
+ 1)/(sqrt(a**2 + 1) + sqrt(a**2) + 1) - sqrt(a**2)/(sqrt(a**2 + 1) +
sqrt(a**2)
+ 1) - 1/(sqrt(a**2 + 1) + sqrt(a**2) + 1))*(sqrt(a**2 + 1) + sqrt(a**2) +
1)/s
qrt(a**2 + 1), a*((sqrt(a**2)/2 + 1)/(sqrt(a**2 + 1) + sqrt(a**2) + 1) -
sqrt(a*
*2)/(sqrt(a**2 + 1) + sqrt(a**2) + 1) - 1/(sqrt(a**2 + 1) + sqrt(a**2) +
1))*(sq
rt(a**2 + 1) + sqrt(a**2) + 1)/sqrt(a**2 + 1)), sqrt(a**2)/(sqrt(a**2 + 1)
+ sqr
t(a**2) + 1) + 1/(sqrt(a**2 + 1) + sqrt(a**2) + 1) <= (sqrt(a**2)/2 +
1)/(sqrt(a
**2 + 1) + sqrt(a**2) + 1)))
_.subs(a, 1)
Point(1, 1/2)
Perhaps a fortuitous cancellation of errors? or perhaps when a value is
finally substituted, only one of the conditions succeeds.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.