Calculate rectangle position after scaling from his center












0












$begingroup$


I have a rectangle with these bounds



height: 31.010414123535156
width: 215.8330078125
x: 10.95849609375
y: 90.49478912353516


I want to scale up the rectangle by a 0.541667 factor.
X, Y coordinates are coordinates of the top left corner.



I know that the scale origin is the center of the rectangle.



To find the width and height I simply did this calculate



newWidth = width / 0.541667
newHeight = height / 0.541667


But I can't figure out how to calculate the new x and y coordinates.



Which gives me these bounds



height: 57.25
width: 398.4609375
x: -80.35546875 //how to find this value ?
y: 77.375 //how to find this value ?









share|cite|improve this question











$endgroup$

















    0












    $begingroup$


    I have a rectangle with these bounds



    height: 31.010414123535156
    width: 215.8330078125
    x: 10.95849609375
    y: 90.49478912353516


    I want to scale up the rectangle by a 0.541667 factor.
    X, Y coordinates are coordinates of the top left corner.



    I know that the scale origin is the center of the rectangle.



    To find the width and height I simply did this calculate



    newWidth = width / 0.541667
    newHeight = height / 0.541667


    But I can't figure out how to calculate the new x and y coordinates.



    Which gives me these bounds



    height: 57.25
    width: 398.4609375
    x: -80.35546875 //how to find this value ?
    y: 77.375 //how to find this value ?









    share|cite|improve this question











    $endgroup$















      0












      0








      0





      $begingroup$


      I have a rectangle with these bounds



      height: 31.010414123535156
      width: 215.8330078125
      x: 10.95849609375
      y: 90.49478912353516


      I want to scale up the rectangle by a 0.541667 factor.
      X, Y coordinates are coordinates of the top left corner.



      I know that the scale origin is the center of the rectangle.



      To find the width and height I simply did this calculate



      newWidth = width / 0.541667
      newHeight = height / 0.541667


      But I can't figure out how to calculate the new x and y coordinates.



      Which gives me these bounds



      height: 57.25
      width: 398.4609375
      x: -80.35546875 //how to find this value ?
      y: 77.375 //how to find this value ?









      share|cite|improve this question











      $endgroup$




      I have a rectangle with these bounds



      height: 31.010414123535156
      width: 215.8330078125
      x: 10.95849609375
      y: 90.49478912353516


      I want to scale up the rectangle by a 0.541667 factor.
      X, Y coordinates are coordinates of the top left corner.



      I know that the scale origin is the center of the rectangle.



      To find the width and height I simply did this calculate



      newWidth = width / 0.541667
      newHeight = height / 0.541667


      But I can't figure out how to calculate the new x and y coordinates.



      Which gives me these bounds



      height: 57.25
      width: 398.4609375
      x: -80.35546875 //how to find this value ?
      y: 77.375 //how to find this value ?






      geometry transformation






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 29 '18 at 9:49







      zaarr78

















      asked Dec 29 '18 at 9:21









      zaarr78zaarr78

      32




      32






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Your results make sense only if your $x$-axis goes from left to right, $y$-axis goes from top to bottom and $(x,y)$ denotes the coordinate of the top left corner of the rectangle. Such coordinate system is typically used for computer screens. In that case:



          newX = x + width/2 - newWidth/2
          newY = y + height/2 - newHeight/2


          Check your values and you'll see that the numbers match.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            X, Y coordinates are top left corner I updated my question
            $endgroup$
            – zaarr78
            Dec 29 '18 at 9:49












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3055683%2fcalculate-rectangle-position-after-scaling-from-his-center%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0












          $begingroup$

          Your results make sense only if your $x$-axis goes from left to right, $y$-axis goes from top to bottom and $(x,y)$ denotes the coordinate of the top left corner of the rectangle. Such coordinate system is typically used for computer screens. In that case:



          newX = x + width/2 - newWidth/2
          newY = y + height/2 - newHeight/2


          Check your values and you'll see that the numbers match.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            X, Y coordinates are top left corner I updated my question
            $endgroup$
            – zaarr78
            Dec 29 '18 at 9:49
















          0












          $begingroup$

          Your results make sense only if your $x$-axis goes from left to right, $y$-axis goes from top to bottom and $(x,y)$ denotes the coordinate of the top left corner of the rectangle. Such coordinate system is typically used for computer screens. In that case:



          newX = x + width/2 - newWidth/2
          newY = y + height/2 - newHeight/2


          Check your values and you'll see that the numbers match.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            X, Y coordinates are top left corner I updated my question
            $endgroup$
            – zaarr78
            Dec 29 '18 at 9:49














          0












          0








          0





          $begingroup$

          Your results make sense only if your $x$-axis goes from left to right, $y$-axis goes from top to bottom and $(x,y)$ denotes the coordinate of the top left corner of the rectangle. Such coordinate system is typically used for computer screens. In that case:



          newX = x + width/2 - newWidth/2
          newY = y + height/2 - newHeight/2


          Check your values and you'll see that the numbers match.






          share|cite|improve this answer











          $endgroup$



          Your results make sense only if your $x$-axis goes from left to right, $y$-axis goes from top to bottom and $(x,y)$ denotes the coordinate of the top left corner of the rectangle. Such coordinate system is typically used for computer screens. In that case:



          newX = x + width/2 - newWidth/2
          newY = y + height/2 - newHeight/2


          Check your values and you'll see that the numbers match.







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Dec 29 '18 at 10:04

























          answered Dec 29 '18 at 9:28









          OldboyOldboy

          9,54911138




          9,54911138












          • $begingroup$
            X, Y coordinates are top left corner I updated my question
            $endgroup$
            – zaarr78
            Dec 29 '18 at 9:49


















          • $begingroup$
            X, Y coordinates are top left corner I updated my question
            $endgroup$
            – zaarr78
            Dec 29 '18 at 9:49
















          $begingroup$
          X, Y coordinates are top left corner I updated my question
          $endgroup$
          – zaarr78
          Dec 29 '18 at 9:49




          $begingroup$
          X, Y coordinates are top left corner I updated my question
          $endgroup$
          – zaarr78
          Dec 29 '18 at 9:49


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3055683%2fcalculate-rectangle-position-after-scaling-from-his-center%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bundesstraße 106

          Verónica Boquete

          Ida-Boy-Ed-Garten