enter image description here

We have two graphics, big and small, we know x/y of the big graphic.

How to get the coords x/y of a small graphic?

<?php
$graph1_x = 100;
$graph1_y = 50;

$coords_graph1_x = 30;
$coords_graph1_y = 40;

$graph2_x = 70;
$graph2_y = 25;

// How to get x/y of graph2 using graph1 ?

?>
link|improve this question
Unrelated to computer hardware and computer software. – Daniel Beck Jan 26 at 14:15
it's for my PHP script, it's related to pc & software. How else I can ask it? Using php code? OK. – waza123 Jan 26 at 14:18
Belongs on stackoverflow. – GreenMatt Jan 26 at 14:26
feedback

closed as off topic by sblair, Daniel Beck, Dennis, slhck, Dave M Jan 26 at 14:32

Questions on Super User are expected to generally relate to computer software or computer hardware, within the scope defined in the faq.

1 Answer

up vote 0 down vote accepted

It is a simple conversion using ratios if you are using proportional scaling.

x_new = x_org/x_orgmax * x_newmax

Same for y_new

link|improve this answer
Thank u!!!!!!!! – waza123 Jan 26 at 14:23
feedback

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