0

A more detailed explanation.
Consider a 2D graph with an x and y axis. A ring can be formed by an ordered pair of non-negative integers (a, b), where a and b represent a radius from the center of the graph (0, 0), to the edge of an inner circle and the edge of an outer circle, respectively. The space between these two circles forms a ring around the center.

Image example:

The ring is formed by (7,8)

I want to find an algorithm for determining the smallest possible ordered pair of non-negative integers that form a ring that also contains a given point. Other than just trial and error and eyeballing it.

For context, this is for a machine learning problem where I am searching for hypotheses (rings) that are consistent with a set of instances (given points). So while the context is machine learning, this sub-problem seems to be a coordinate geometry problem, for which I am evidently lacking in capability.

  • The distance of the point $(x,y)$ from $(0,0)$ is $r = \sqrt{x^2+y^2}$. Why not take a pair of integers that surround $r$? For example if $r=2.71$, take $a=2$ and $b=3$. – Gribouillis Apr 26 '23 at 09:45
  • @Gribouillis Oh my. That is very simple. And works very well. Thank you. I feel dumb for even asking this question now. I've been pondering this for a few days. Should i delete this question? I'm very paranoid about polluting stack exchange. – Matthew Lategan Apr 26 '23 at 09:50

0 Answers0