sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    A little xmas eve math (help)

    Scheduled Pinned Locked Moved Corner Bar
    11 Posts 3 Posters 341 Views 3 Watching
    Loading More Posts
    • 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.
    • jeff hammondJ Offline
      jeff hammond
      last edited by

      for whatever reason, i'm not seeing a simpler way to do this but i know it's out there..

      all fractions feeding into this will be sixteenths between 0 and 1 {1/16, 1/8, 3/16, 1/4, etc...}

      the goal is to get the multiplier(s) for the original fraction that will give me the two preceding numbers..

      ie— in this example, i start with 1/2.. i need to multiply 1/2 by (x) in order to get 7/16 then again to get 3/8..

      this is working as i have it but it feels a bit overboard...

      %(#008040)[set fraction to (1 / 2)
      set target1 to (fraction - 0.0625)
      set target2 to (fraction - 0.125)
      set multiplier1 to target1 / fraction
      set multiplier2 to target2 / fraction

      multiplier1 = .875
      multiplier2 = .75]

      i could now multiply 1/2 by .875 to get 7/16
      and by .75 to get 3/8..

      anybody seeing a more sensible way?
      thanks

      (going out for a bit.. you have an hour.. ready,set,go! 😄 💚 )
      thanks

      [edit] oh.. and i don't necessarily need two variables at the end (multi1 and 2)..
      it could end up being something like
      (multiplier * fraction) = 7/16 and
      ((multiplier * ?) * fraction) = 3/8

      dotdotdot

      1 Reply Last reply Reply Quote 0
      • Rich O BrienR Offline
        Rich O Brien Moderator
        last edited by

        8/16 * 14/16 = 7/16
        0.5 * 0.875 = 0.4375

        8/16 * 12/16 = 6/16
        0.5 * 0.75 = 0.375

        8/16 * 10/16 = 5/16
        0.5 * 0.625 = 0.3125

        Therefore...

        12/16 * x/16 = 11/16

        12 * x = 11

        12x = 11

        x = 11/12

        12/16 * 11/12 = 11/16

        So to answer your question [from my point of view] your looking at multiplication in alegbra because this seems to work everytime

        9/16 * x/16 = 8/16

        9 * x = 8

        9x = 8

        x = 8/9

        9/16 * 8/9 = 8/16

        Download the free D'oh Book for SketchUp 📖

        1 Reply Last reply Reply Quote 0
        • jeff hammondJ Offline
          jeff hammond
          last edited by

          @unknownuser said:

          So to answer your question [from my point of view] your looking at multiplication in alegbra because this seems to work everytime

          9/16 * x/16 = 8/16

          9 * x = 8

          9x = 8

          x = 8/9

          9/16 * 8/9 = 8/16

          right.. that's the way i'm doing it right now (albeit a little differently / less steps)
          in this case, with 9/16 , you're showing the result for one of the numbers i need (multiplier1) so leaving out the calculations for multiplier2, it does this:

          set fraction to (9 / 16) _________ meaning I'm starting out with 9 / 16
          set target1 to (fraction - 0.0625) which is a simpler way to get 8 / 16
          set multiplier1 to (target1 / fraction) or (8/16 ÷ 9/16) which is the same thing as 8/9

          9/16 * 8/9 = 8/16

          that said, it doesn't seem like the quick way to get from A->B... especially when considering i want 2 preceding numbers instead of just the one..
          meh.. i'm probably going to keep thinking about this one until 1) i give up, 2) i figure it out, 3) someone else figures it out..
          probably 1 or 3 😄

          [edit] oh wait, i'm confused..
          what's this doing?:

          9/16 * x/16 = 8/16

          dotdotdot

          1 Reply Last reply Reply Quote 0
          • Rich O BrienR Offline
            Rich O Brien Moderator
            last edited by

            If I have 3/16 and want to know what to multiply by to get 2/16 and 1/16 I do this...

            3/16 = 2/16 therefore * 2/3
            3/16 = 1/16 therefore * 1/3

            In my head I see...

            162/316 = 32/48 = 2/3

            Download the free D'oh Book for SketchUp 📖

            1 Reply Last reply Reply Quote 0
            • jeff hammondJ Offline
              jeff hammond
              last edited by

              @unknownuser said:

              If I have 3/16 and want to know what to multiply by to get 2/16 and 1/16 I do this...

              3/16 = 2/16 therefore * 2/3
              3/16 = 1/16 therefore * 1/3

              In my head I see...

              162/316 = 32/48 = 2/3

              oh right.. maybe i forgot to mention 😄

              it's part of a script.. so i can't just assume it sees these things.. and for me to make it see what you're seeing would add more steps.. (it might be simple to do if the fractions coming in were 8/16 or 12/16 but they aren't.. they're 1/2 and 3/4 in those cases, although we can immediately see 1/2 -> 7/16, the script can't..)
              [but actually, there might be a quick little way to do this in the script which will in fact streamline it some ❓ ]

              dotdotdot

              1 Reply Last reply Reply Quote 0
              • Rich O BrienR Offline
                Rich O Brien Moderator
                last edited by

                I know my thinking is based on some formula I've forgotten...

                x/y * a/b = q/r

                x * a = q / y * b = r

                Or something along those lines. From these you can extract roots so...

                x * a = q

                ax = q

                x = a/q

                Now I'm lost 😕

                Just press print

                Download the free D'oh Book for SketchUp 📖

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  in Applescript [or Ruby]

                  9/16*8/9
                  returns
                  0

                  Or, you can convert integers to floats by adding .0

                  9.0/16.0*8.0/9.0
                  returns
                  0.5

                  any help?

                  john

                  PS. merry xmas

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • jeff hammondJ Offline
                    jeff hammond
                    last edited by

                    ^ maybe you have an older version of applescript since you're on leopard? because if i use 9/16 * 8/9, i will get 0.5.. (but it compiles to 9 / 16 * 8 / 16 (with spaces) then calculates..

                    that said, i'm mostly using the decimal numbers of these fractions for the calculations while the user will see the fraction ( 1/2" = 1' type of stuff).. otherwise, i've been doing
                    (9 ÷ 16) ÷ (8 ÷ 9)

                    and that aside, i found a simple way to do what i was originally asking in this thread.. a two liner to get both of the multipliers i need.. i had some other variables set for another part of the script that i was also able to use for this part..

                    dotdotdot

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      driven
                      last edited by

                      I read something about the maths update for lion or snow... least you have a solution.

                      I've got a 3 button multi-sheet to scale version of PrintRight working [but clunky]

                      did you ever try the single button one?

                      john

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply Reply Quote 0
                      • jeff hammondJ Offline
                        jeff hammond
                        last edited by

                        @driven said:

                        I read something about the maths update for lion or snow... least you have a solution.

                        I've got a 3 button multi-sheet to scale version of PrintRight working [but clunky]

                        did you ever try the single button one?

                        john

                        i actually have a version of PrintRight that's working very well right now.. i'm going to make a preview video a little later today and put it in that thread.. there are still some things i don't like about it right (well, personally I like it because it does exactly what I need it to do.. i'll have to mess around with it some more before making it publicly available)

                        dotdotdot

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          driven
                          last edited by

                          Other then wanting to be able to 'PrintRight' on a mac, I've just been working on it as an excuse to finally learn some ruby...
                          and try out some ideas for another project...

                          PM me your latest if you want any input, Leopard or Snow [I switched my macBookPro over]

                          john

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement