ID:1891928
 
(See the best response by Kaiochao.)
Code:
for(var/turf/A in oview(3,src))
A.icon += rgb(0,0,100)


Problem description:

I want to grab atoms within a range in a circular shape, like how luminosity works. HOWEVER, view & range works in squares. I found this useful library explaining how to do this, however the files are not found.
Best response
luminosity works in squares to be consistent with view(), range(), get_dist(), etc.

If you want circles, you can basically look through the bounding box (the smallest region containing every potential point in your desired circle), then check for the distance between each point and the center of the circle, using Euclidean distance (as opposed to Chebyshev distance used by get_dist()).

for(var/turf/A in oview(3, src))
var dx = x - A.x
var dy = y - A.y
var dist_squared = dx*dx + dy*dy
if(dist_squared <= 3*3)
A.icon += rgb(0, 0, 100)

It's more efficient to compare the squared distance with the squared radius, to avoid sqrt().
Seems inconvenient, but w/e. Thanks
As a proper lazy programmer, you should get into the habit of generalizing things like this into procs:
atom
proc/DistanceTo(atom/A)
var dx = A.x - x
var dy = A.y - y
return sqrt(dx*dx + dy*dy)

proc/GetCircle(Radius = 1)
. = list()
for(var/atom/a in range(Radius, src))
if(DistanceTo(a) <= Radius)
. += a

Then you can just do something like this:
for(var/turf/A in GetCircle(3))
A.icon += rgb(0, 0, 100)

Make it clear what your code does by splitting them up into procs. As an added bonus, you can reuse them for other things. Being lazy is good; don't write too much.
In response to Kaiochao
But if you care at all about optimization, don't do that.

atom/proc/GetCircle(radius = 1)
. = list()
var/rsq = radius * (radius+1) // this works out to the floor of (radius+0.5)**2
var/dx, dy, dsq
for(var/atom/a in range(radius, src))
dx = a.x - x
dy = a.y - y
dsq = dx*dx + dy*dy
if(dsq <= rsq) . += a

Further refinements are of course possible, and you could use block() to be sure to get a range bigger than what range() can actually support (world.view*2).

This code is a lot faster because 1) it doesn't have the unnecessary overhead of calling a subproc, and 2) it avoids a costly square root operation by working directly with squares.