POV-Ray : Newsgroups : povray.advanced-users : Tough math help needed : Re: Tough math help needed Server Time
29 Jul 2024 16:25:59 EDT (-0400)
  Re: Tough math help needed  
From: Alberto
Date: 27 Aug 2001 20:36:09
Message: <3B8AE6F7.21E0D2B7@usb.ve>
Peter Popov wrote:
> 
> ... 
>  D-----C
> /     /
> A    /
>  \_B/
> 
> AB and DC belong to one set of rulers, [1] and AD and BC belong to the
> other, [2]. Now, if we take two points on AB and DC, M and N resp., so
> that the AM:AB = DN:DC, the line MN will belong to [1] and will have a
> U coordinate of exactly that ratio. Let's choose M and N so that that
> ratio is a. The point P' on MN for which MP':MN = b then has UV
> coordinates a and b (directly follows from the above). Let's find its
> XY coordinates:
> 
> (note: everything is vectors, i.e. AB = B - A, except a and b)
> 
> AM = a*AB
> DN = a*DC
> MN = AN - AM = AD + DN - AM
> MP' = b*MN = b*(AD + DN - AM) = b*(AD + a*DC - a*AB) =
>     = b*(AD + a*(DC - AB))
> AP' = AM + MP' = a*AC + b*(AD + a*(DC - AB))
> P' = A + AP' = A + a*AC + b*(AD + a*(DC - AB))
> 
> OK, this was the easy part :)
> 
> Now, knowing A, B, C, D and P', how do I find a and b (or P, it's the
> same)?

In your last equation, a and b are the unknowns. Take the inner product
of this equation with say, AB. You will end with  a scalar equation.
Take the inner product of your last equation with AD and you'll get a
second equation. Now you have a pair of equations with two unkowns. This
system should be soluble.

Alberto.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.