I don't know much about Mathematica, but does it give solutions when there is an infinite number of them?
Usually Mathematica will give you every solution, even ones you don't want.
The problem here is that, when a set of numbers (a0, b0, c0) is a solution, then (n*a0, n*b0, n*c0) is also a solution for all n (except 0.) Actually, G is determined by the ratio a:b:c.
Sorta correct; that's another way to add a constraint (by putting 1:b1:c1=a:b:c to obtain one of solutions.)
If we suppose that a=1 then this will became 2 equations system.
Is this correct?
If you don't still follow, consider the following scales as a simplified example. Given the mass of each weight, it is easy to determine the balancing point C.
| | +--------+-----------------+ | C | +--+--+ +--+--+ | 50g | | 25g | | | +-----+ +-----+ |<------>|<--------------->| 10cm 20cmHowever, the reverse isn't generally possible. If weights are unknown, all we can tell is that M1=2*M2 (or M1:M2=2:1) unless there is additional information (e.g. M1 is a constant.)
| | +--------+-----------------+ | C | +--+--+ +--+--+ | ? | | ? | | | +-----+ +-----+ M2 M1 |<------>|<--------------->| 10cm 20cm
As for solving the problem: supposing that , the aforementioned three equations are tranformed as following.
a(Ax-Gx) + b(Bx-Gx) + c(Cx-Gx) = 0
a(Ay-Gy) + b(By-Gy) + c(Cy-Gy) = 0
a(Az-Gz) + b(Bz-Gz) + c(Cz-Gz) = 0
The first one represents a 3-d plane whose normal vector is (Ax-Gx, Bx-Gx, Cx-Gx) and passes the point (0, 0, 0). The latter two represent other planes all passing (0, 0, 0). Solving the above simultaneous equations is equivalent to finding the intersection of those three planes. It is apparent that they intersect at (0, 0, 0), but it isn't the solution because of the restriction that a+b+c is not 0. To have intersection point other than (0, 0, 0), all of three planes must share the same intersection line (i.e. their normal vector is on a same plane.) All solutions lie on this common intersection line.
So, we only have to calculate the intersection line between the first two (the other one also shares the same line.) Now, let the direction vector of the intersection line (Va, Vb, Vc). This is perpendicular to the normal vector of two planes. So, just calculate the cross production:
Va = (Bx-Gx) * (Cy-Gy) - (Cx-Gx) * (By-Gy)
Vb = (Cx-Gx) * (Ay-Gy) - (Ax-Gx) * (Cy-Gy)
Vc = (Ax-Gx) * (By-Gy) - (Bx-Gx) * (Ay-Gy)
Choose an arbitray number t (that is not 0), then you can derive a, b and c as:
a = t * Va
b = t * Vb
c = t * Vc
Edited by torigara, 18 November 2010 - 10:37 AM.