Results 1 to 20 of 20

Thread: Solving this formula, could anyone help??

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Question Solving this formula, could anyone help??

    Can anyone solve this, to find X, Y and Z please?? a,b,c,d,e,f,v are known values. This has been sending me mad trying to solve it .
    VB Code:
    1. 2ad + 2be + 2cf = X(a+d) + Y(b+e) +Z(c+f)
    2.  
    3. 'Other known facts are:
    4. u = Sqr(a^2 + b^2 + c^2)
    5. n = Sqr(d^2 + e^2 + f^2)
    6. u = n
    7. 'So:
    8. a^2 + b^2 + c^2 = d^2 + e^2 + f^2
    9. 'Also:
    10. v^2 = X^2 + Y^2 + Z^2
    Any help would be greatfully appreciated.
    This all came from this by the way:
    VB Code:
    1. 0 = aX + bY + cZ
    2. 0 = dX + eY + fZ
    3. 0 = ad + be + cf
    4. v^2 = X^2 + Y^2 + Z^2
    There should be two answers for this.
    Thanx for any help.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  2. #2
    Addicted Member TheAlchemist's Avatar
    Join Date
    Jan 2003
    Location
    Dar-esSalaam,Tanzania
    Posts
    139
    hey there mate,

    i think its possible to solve for x,y and z from the initial equations:

    0 = aX + bY + cZ
    0 = dX + eY + fZ
    0 = ad + be + cf
    v^2 = X^2 + Y^2 + Z^2
    If a,b,c,d,e,f are known, then its a simple matter of substituting their values and solving three simultanaeous eqns. Is this what you wanted?
    One thing that sustains me through life is the conciousness of the immense inferiority of everyone else
    --Oscar Wilde

  3. #3

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Yea thanx thats what I was after but I posted at the top how far I'd got, Then I realised I might have gone down the wrong track so thort it'd be a good idea to post what I started from aswell.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  4. #4

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    I still need to keep a,b,c,d,e,f,v as a,b,c,d,e,f,v because i'm putting this into code so I need to solve this algebraically
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  5. #5

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    He's a pic to help explain it:
    Attached Images Attached Images  
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  6. #6

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Sorry to make this the 4th post in a row but I've managed to add this to it:
    Code:
    dX + eY + fZ = rd + se + tf
    r, s and t are more known values.
    This is starting to get really bad
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  7. #7

  8. #8

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    k, Thanx Loads
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  9. #9
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383
    Do you have to solve it generally?
    It would make things a whole lot simpler it you could give us the known values

  10. #10

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    No, I need to put it into code so the values will change for different times the procedure is run
    Don't forget there'll be two results as well, probably just a +/- thing on a SqRt
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  11. #11
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383
    Rearrange the first equation to
    X=-(bY+cZ)/a
    and the second to:
    X=-(eY+fZ)/d

    This gives
    -[(bY+cZ)/a]=-[(eY+fZ)/d]

    Then
    Y(db-ae)=Z(af-dc)

    You then have a relationship for Z based on Y and X based on Z and Y.

    You can then substitute for X and Y into the equation for V^2 to give you values of V^2 based on Z

    I hope you can follow this because it is a lot of typing if you need me to write it out in full!

  12. #12
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383
    hmm, got someone else to look at it, not so clear huh?

    define a value K=(dc-af)/(ae-db)
    then
    V^2=Z^2[ (K+c)^2 /a^2 + K^2 +1]

    define another value
    M=1/[ (K+c)^2 / a^2 + K^2 +1 ]

    Gives you

    X^2 = V^2 (1-K^2 M -M)

    Y^2 = V^2 K^2 M

    Z^2 = V^2 M

    Dunno if that helps or not?

  13. #13

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    thats great thanx, I'll check them out and let you know how it goes .
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  14. #14

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    just one problem: In the second solution theres this line that I don't understand:
    VB Code:
    1. X^2 = V^2 (1-K^2 M -M)
    2.  
    3. 'Is it ment to be:
    4. X^2 = V^2 (1 - K^2 * M * (-M)) '??
    5. 'I ask this because I don't think this would make sense:
    6. X^2 = V^2 (1 - K^2 * (M - M))
    Just to be sure
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  15. #15
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    maybe its just
    X^2 = V^2 (1 - K^2 * M - M)
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  16. #16

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Yea but:
    VB Code:
    1. X^2 = V^2 (1 - K^2 * M - M)
    2. 'Is the same as:
    3. X^2 = V^2 (1 - K^2 * (M - M))
    4. 'And that would simplify to:
    5. X^2 = V^2 (1 - K^2 * 0)
    6. ' =>
    7. X^2 = V^2
    I'm goint to have to assume its X^2 = V^2 (1 - K^2 * M * (-M)) and once i've done that the 3D thing thing be finished cyborg

    I suppose it could be X^2 = V^2 (1 - (K^2 * M) - M) ??
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  17. #17
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    wouldn't this:
    X^2 = V^2 (1 - K^2 * M - M)
    be the same as this:
    X^2 = V^2 (1 - (K^2 * M) - M)
    ??
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  18. #18

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Yea, sorry cyborg.

    I have a problems now tho, the second solution doesn't like it if some of the variables are zero when I first tested it most of them were zero and the VB deguger had a field day . I'm now gona try the first solution you said and see what happens

    agmorgan: You any good with vectors??
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  19. #19

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Hiya, I think I have it do you reckon this works, its what I got after finishing off your method agmorgan:
    VB Code:
    1. p = (af - dc) / (db - ae)
    2. q = 1 / p
    3.  
    4. Z^2 = V^2 / [1 + p^2 - (b^2 p^2 + c^2 + 2bpc)/a^2]
    5. Y^2 = V^2 / [1 + q^2 - (c^2 q^2 + b^2 + 2bpc)/a^2]
    6. X^2 = V^2 - Y^2 - Z^2
    It seems zero friendly aswell
    Thanx loads, I'll see if it work with what I want it to now. Fingers crossed.

    EDIT: Nope, it doesn't like zeros, the p and q bit causes the problem as far as zero goes. Also it just doesn't seem to be working. I'm going to have to see if I can find where the problem is comming from and maybe try something else. Dam ArcCos(Cos(x)) = x for 0 < x < 180, why not 0 < x < 360 then I wouldn't have had to do this in the first place.
    Last edited by Electroman; Jul 25th, 2003 at 07:53 AM.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  20. #20
    New Member
    Join Date
    Aug 2003
    Location
    UK
    Posts
    3
    Not sure if this helps but here is a link to a simultaneous equation solver.

    If you contact them maybe they can help you

    http://web.ask.com/redir?bpg=http%3a...%2falgebra.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width