0
$\begingroup$

Suppose a image has

Height = 200px;
Width = 100px; 

A point in that image which has

Y axis = 40px
X axis = 30px

Now if I resize that image:

New Height = 300px;
New Width = 150px;

Is there any formula to calculate new Y and X axis of that point?

$\endgroup$
1
$\begingroup$

Provided that the stretch is simply linear and consistent across the image, then the displacement of the point is proportional to the magnification factor.

For the X-Axis:

  • At $100px$ width, the point was at $30$
  • At $150px$ width, where would the point be? (Let's call this our unknown $x$).

$$x=\frac{150}{100} \times 30 = 45$$

Similarly, for the Y-Axis, the point will now be at $60$.

Hope this helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.