<p>I want to select a pixel within a circle of a certain radius. But the radius is expressed in a decimal form (0.12). What does it mean to have a radius equal to 0.12? And concretely how to pick a pixel within a circle having such a radius?</p>

<p><a href="https://i.sstatic.net/ksGCK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ksGCK.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-01-11T19:05:36.990Z
What units is the radius measured in? It doesn't make a lot of sense to have a radius of 0.12 pixels (it would just be the one center pixel). It's probably 0.12 centimeters, or 0.12 ems, or something like that.
Nathan Reed
CC BY-SA 3.0
2016-01-11T20:44:44.263Z
Also what does it mean to 'pick a pixel'? Given a pixel coordinate, do you want to know if it is inside the circle?
Rotem
CC BY-SA 3.0
2016-01-11T21:59:37.363Z
By "to pick a pixel" I meant to randomly choose a pixel inside the circle. The units are not mentioned. The circle has a center C(Cx, Cy), which is a pixel. My guess is, a pixel inside the circle has coordinates P(Px, Py) such that sqrt((Px-Cx)^2+(Py-Cy)^2) < 0.12 (the distance between P and the center C is less than the radius) . That's the most logical way to think about it in my opinion.
S.E.K.
CC BY-SA 3.0
2016-03-07T04:11:23.850Z
I'm betting the 0.12 is in "uv space" meaning it's 12% of the image size (on each axis).
Alan Wolfe
<c++>
Selecting pixels within a circle having a decimal (non integer) radius
S.E.K.
# Selecting pixels within a circle having a decimal (non integer) radius

(Asked by: username_0 on 2016-01-11)

I want to select a pixel within a circle of a certain radius. But the radius is expressed in a decimal form (0.12). What does it mean to have a radius equal to 0.12? And concretely how to pick a pixel within a circle having such a radius?

[![enter image description here](https://i.sstatic.net/ksGCK.png)](https://i.sstatic.net/ksGCK.png)

**Tags:** c++

> **Comments:**
> **username_1**: What units is the radius measured in? It doesn't make a lot of sense to have a radius of 0.12 pixels (it would just be the one center pixel). It's probably 0.12 centimeters, or 0.12 ems, or something like that.  
> **username_2**: Also what does it mean to 'pick a pixel'? Given a pixel coordinate, do you want to know if it is inside the circle?  
> **username_0**: By "to pick a pixel" I meant to randomly choose a pixel inside the circle. The units are not mentioned. The circle has a center C(Cx, Cy), which is a pixel. My guess is, a pixel inside the circle has coordinates P(Px, Py) such that sqrt((Px-Cx)^2+(Py-Cy)^2) < 0.12 (the distance between P and the center C is less than the radius) . That's the most logical way to think about it in my opinion.  
> **username_3**: I'm betting the 0.12 is in "uv space" meaning it's 12% of the image size (on each axis).  

---

## 0 answers

