c++ - Function to approach a number asymptotically -
i have map can zoom in , out of. gridlines display latitude , longitude. right zoom in shrinking borders specific amount.
say top edge lat 30n, bot edge lat 28n, left edge lon -40w, right edge lon -38w.
so 1 zoom in, new edges 29.5n, 28.5n, -39.5w,-38.5 respectively.
zooming in enough times make opposite edges equal each other , flip.
so next zoom in top , bot edge 29n, 29n , next 28.5n,29.5n flips orientation.
i'm looking function or way can continuously zoom in, never have edges equal each other or flip. in others words can edges continuously closer , closer each other, never touch.
so have idea i'll need function
lim x-> infinity of x/(x+1) - 1 + midpoint of 2 edges
which means, zoom in approach midpoint. if valid, don't know how implement limits in c++.
this 1 equation too. have 2 edges on each axis , i'd need 2 equations approach midpoint both sides @ equal rate.
Comments
Post a Comment