HEY ALL
so i have a maths problem and i need to figure out a formula. im sure its easy but its escaping me atm
so i have a picture and i need to make sure it doesnt go outside a box
the picture can be magnified up to 3x
and the x and y coordinates can be changed
at 1x magnification the max the x coordinate can be is 700
but if i change it to 2x or 3x magnification at 700 it goes outside the box
i need a formula that when i change the magnification to 2x or 3x it needs to make the x coordinate smaller by a percentage or a ratio or something...
my code at the moment looks like this (user inputs are xbox (x coordinate) ybox (y coordinate) magbox (magnification)
DrawWings(paper, xBox, yBox, magBox)
my first thought was to do this
DrawWings(paper, (xBox / magBox), (yBox / magBox), magBox)
but that didnt work obviously... the / being the divide by sign.... i think im gonna end up kicking myself when i know the answer
so i have a maths problem and i need to figure out a formula. im sure its easy but its escaping me atm
so i have a picture and i need to make sure it doesnt go outside a box
the picture can be magnified up to 3x
and the x and y coordinates can be changed
at 1x magnification the max the x coordinate can be is 700
but if i change it to 2x or 3x magnification at 700 it goes outside the box
i need a formula that when i change the magnification to 2x or 3x it needs to make the x coordinate smaller by a percentage or a ratio or something...
my code at the moment looks like this (user inputs are xbox (x coordinate) ybox (y coordinate) magbox (magnification)
DrawWings(paper, xBox, yBox, magBox)
my first thought was to do this
DrawWings(paper, (xBox / magBox), (yBox / magBox), magBox)
but that didnt work obviously... the / being the divide by sign.... i think im gonna end up kicking myself when i know the answer
Comment