How do you reverse an equation?

  • Level: High School 
  • Thread starter Thread starter eNathan
  • Start date Start date
  • Tags Tags
    Reverse
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 6K views
eNathan
Messages
351
Reaction score
2
I have an equation, that I used in a software I made (Delphi). Now, I want to sort of "reverse" this equation.

Y = 0-((( ClickedY * (1800 / PicHeight ))*2)-1800)
X = (( ClickedX * (1800 / PicWidth ))*2)-1800

What does ClickedY = if you know Y and the PicHeight?

what does ClickedX = if you know X and the PicWidth?

:confused:

Thanks in advance, hopefully, there is a mathematician that can solve this.
 
Mathematics news on Phys.org
Easy. Just solve for ClickedX and ClickedY. Surely you can do this.
 
Y = 0 - ((( ClickedY * (1800 / PicHeight ))*2)-1800)
-Y = ((( ClickedY * (1800 / PicHeight ))*2)-1800)
1800 - Y = (ClickedY * (1800 / PicHeight )) *2
(1800 - Y)/2 = ClickedY * (1800 / PicHeight )
ClickedY = PicHeight/1800 * (1800 - Y)/2,

and similarly for the other equation.
 
OK, is this it.

Y = 0-((( ClickedY * (1800 / PicHeight ))*2)-1800)
X = (( ClickedX * (1800 / PicWidth ))*2)-1800

clickedX = ((PicHeight / 1800) * X) / 2
clickedY = ((PicWidth / 1800) * Y) / 2