Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: A little schoolboy math (but my schooldays were a long time ago).

by kal (Hermit)
on Feb 01, 2004 at 15:43 UTC ( [id://325706]=note: print w/replies, xml ) Need Help??


in reply to A little schoolboy math (but my schooldays were a long time ago).

The other answers seem right, so I will just pedant the point a little bit :)

Can you assume that the solution of P is a single point? If not (for example, A=B=C=D=0.5), your solution might be a line. Your calculation may fail with a divide by zero.

Can you assume that the lines definitely do cross? If they don't, at best you will get an answer of (x>1). At worst, they will be parallel lines and you'll get some lovely division by zero error (depending how you calculate the answer).

Can you assume that both lines intersect the same two sides? If not, y=mx+c based calculations will fall apart somewhat with vertical lines, but then I don't think any of the answers given here will hold anyway.

  • Comment on Re: A little schoolboy math (but my schooldays were a long time ago).

Replies are listed 'Best First'.
Re: Re: A little schoolboy math (but my schooldays were a long time ago).
by BrowserUk (Patriarch) on Feb 01, 2004 at 16:45 UTC
Re: Re: A little schoolboy math (but my schooldays were a long time ago).
by Anonymous Monk on Feb 02, 2004 at 04:50 UTC
    Another gotcha is that the lines might not be parallel, but their intersection might fall outside the unit square. Beware :-) Haroldo
      I had that already if you look closely ;o)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://325706]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found