I am trying to find a continuation for a polynomial function
The function is very long, but uses no fractional exponents or
trigonometry

Due to some devisions by zero it is not defined in some places for
which there should be a solution, and I was hoping I could expand it
and then cancel those terms out.

But whenever I try to expand the equation fully, sage hangs
indefinitely. Is there some way around that?

------
For reference, the equation:

R.<m1x,m1y,m2x,m2y,m3x,m3y,m4x,m4y> = QQ[]

# I also tried:
# m1x,m1y,m2x,m2y,m3x,m3y,m4x,m4y = var
('m1x,m1y,m2x,m2y,m3x,m3y,m4x,m4y')


k2 =  ((m1y - m4y)*m3x - (m1x - m4x)*m3y + m1x*m4y - m1y*m4x) / \
         ((m2y - m4y)*m3x - (m2x - m4x)*m3y + m2x*m4y - m2y*m4x)

k3 =  ((m1y - m4y)*m2x - (m1x - m4x)*m2y + m1x*m4y - m1y*m4x) / \
         ((m3y - m4y)*m2x - (m3x - m4x)*m2y + m3x*m4y - m3y*m4x)

f_sqr  =  -((k3*m3y - m1y)*(k2*m2y - m1y) + (k3*m3x - m1x)*(k2*m2x -
m1x)) / \
                                    ((k3 - 1)*(k2 - 1))

whRatio_sqr =  ((k2 - 1)^2 + (k2*m2y - m1y)^2/f_sqr + (k2*m2x - m1x)^2/
f_sqr) / \
                       ((k3 - 1)^2 + (k3*m3y - m1y)^2/f_sqr + (k3*m3x
- m1x)^2/f_sqr)
print whRatio_sqr


This calculates the width/height ratio of a rectangle, given the 4
corner points m1..m4 of an arbitrary perspective projection of said
rectangle, according to 
http://research.microsoft.com/users/zhang/Papers/WhiteboardRectification.pdf

When two sides of the projection are parallel, k2 or k3 are 1, so
f_sqr is not defined, so the ratio is not defined


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to