Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. An algebra question...

An algebra question...

Scheduled Pinned Locked Moved The Lounge
8 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Losinger
    wrote on last edited by
    #1

    I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me: Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1 all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie: n2 = c*(b-d-b*c+a*d). stumped. -c


    Smaller Animals Software, Inc.

    M E M N C 5 Replies Last reply
    0
    • C Chris Losinger

      I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me: Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1 all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie: n2 = c*(b-d-b*c+a*d). stumped. -c


      Smaller Animals Software, Inc.

      M Offline
      M Offline
      Matt Newman
      wrote on last edited by
      #2

      Being as I nearly failed algebra take my advice with this caution. Okay, I think what you are going to have to do is do some factoring. But my brain has stopped functioning tonight so beyond that I have no idea

      -Matt Newman -Matt Newman

      1 Reply Last reply
      0
      • C Chris Losinger

        I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me: Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1 all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie: n2 = c*(b-d-b*c+a*d). stumped. -c


        Smaller Animals Software, Inc.

        E Offline
        E Offline
        Ed Dixon
        wrote on last edited by
        #3

        Believe you are missing an equation. Generally solving for two variables, requires two equations. You have one and some other constaints. Note that as stated, a=0 and b=Q11/Q01 generally works. You can reverse the roles with b=0 and also get a solution. Ed

        S 1 Reply Last reply
        0
        • C Chris Losinger

          I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me: Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1 all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie: n2 = c*(b-d-b*c+a*d). stumped. -c


          Smaller Animals Software, Inc.

          M Offline
          M Offline
          Mustafa Demirhan
          wrote on last edited by
          #4

          If you want to find a unique solution, then you need two linearly independent equations. However, in this case, there are infinitely many solutions (you can find an "a" for every value of "b" and vice versa). If you have two linearly independent equations, then the solution is as follows: Suppose the equations are (the unknowns are x and y) ax + by = k cx + dy = l ==> x = (k - by)/a, substitute this in eq.2 ==> c(k - by)/a + dy = l ==> y = (al - ck)/(ad - cb) ==> and if you substitute this value in x = (k - by)/a, you can find x. Hope this helps. Kind regards Mustafa Demirhan Sonork ID 100.9935:zoltrix

          1 Reply Last reply
          0
          • C Chris Losinger

            I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me: Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1 all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie: n2 = c*(b-d-b*c+a*d). stumped. -c


            Smaller Animals Software, Inc.

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #5

            I didnt know profanity was allowed in the Lounge Nish :-D Sonork ID 100.9786 voidmain www.busterboy.org Nish is a BIG fan of Goran Ivanisevic

            1 Reply Last reply
            0
            • E Ed Dixon

              Believe you are missing an equation. Generally solving for two variables, requires two equations. You have one and some other constaints. Note that as stated, a=0 and b=Q11/Q01 generally works. You can reverse the roles with b=0 and also get a solution. Ed

              S Offline
              S Offline
              Simon Walton
              wrote on last edited by
              #6

              Yep, you need a simultaneous equation. Simon Hey, it looks like you're writing a letter! Sonork ID 100.10024

              1 Reply Last reply
              0
              • C Chris Losinger

                I'm trying to do some interesting geometric manipulations. I've found an algorithm to do what I need, but I don't remember enough algebra to translate the words to code. can anyone help? here's the part that gets me: Compute a and b so that Q11 = a*Q10+b*Q01. This is a set of two linear equations in two unknowns. It turns out that a >= 0, b >= 0, a+b > 1 all of the Q11, Q10 and Q01 are calculated values. the unknowns are a and b. how does one "compute" a and b ? seems to me that there can be many values that satisfy this equation. but, i can't use a range. this a and b have to be used in other equations, ie: n2 = c*(b-d-b*c+a*d). stumped. -c


                Smaller Animals Software, Inc.

                C Offline
                C Offline
                Chris Losinger
                wrote on last edited by
                #7

                i contacted the author of the algorithm about the seemin impossibility of solving for two unknowns.... here's what he told me: Q11, Q10, and Q01 are 2-tuples, so you get two equations, one per component of the vectors. If you define the scalar-valued function Kross((x0,y0),(x1,y1)) = x0*y1 - x1*y0, then a = Kross(Q11,Q01)/Kross(Q10,Q01) and b = Kross(Q11,Q10)/Kross(Q01,Q10) and, he is indeed correct, Q11 and friends are coordinates, not simple values. i hate math. -c


                Smaller Animals Software, Inc.

                S 1 Reply Last reply
                0
                • C Chris Losinger

                  i contacted the author of the algorithm about the seemin impossibility of solving for two unknowns.... here's what he told me: Q11, Q10, and Q01 are 2-tuples, so you get two equations, one per component of the vectors. If you define the scalar-valued function Kross((x0,y0),(x1,y1)) = x0*y1 - x1*y0, then a = Kross(Q11,Q01)/Kross(Q10,Q01) and b = Kross(Q11,Q10)/Kross(Q01,Q10) and, he is indeed correct, Q11 and friends are coordinates, not simple values. i hate math. -c


                  Smaller Animals Software, Inc.

                  S Offline
                  S Offline
                  Sijin
                  wrote on last edited by
                  #8

                  I Love Math. :-D :-D Seriously .. i wasn't a big fan of mathematics. Then i took up an undergrad. course in mathematics and for the first yr i really hated it..then slowly i began to ralize the "Beauty of mathematics"..if someone were to look beyond the rules of mathematics ie. ask Why? instead of How? i think they'll certainly learn a lot more... On another note have u ever wondered what really do we do in mathematics??..Well if you look at it is just a collection of abstract ideas that find implementations in every field..it's only when you realize the motivations for those abstractions and that u'll truly see the wonders of mathematics.. I know i am taking it too far..but i couldn't resist responding. :) :)

                  Warning: Do not execute #include "stdio.h" int main(void) { printf("12\t\b\b"); printf("12\t\b\b"); return 0; } Sonork ID 100.9997 sijinjoseph

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups