java - Why is it a good idea to use Math.min() for x, y coordinates and math.abs() -
why idea use math.min()
x-y coordinates , width , height using math.abs()
method (for rectangle)? thought x-y coordinates positive, i'm confused why matters.
the x,y coordinates represent position of rectangle on plane; can negative since rectangle can place anywhere relative origin (ie. 0,0 position).
the height , width of rectangle must positive negative lenghts not defined.
considering then, makes sense use math.min
position , math.abs
dimension.
Comments
Post a Comment