LC thoughts for intellectual elites

Punk lasted more than a few years @Jalfrezi.

1 Like

Maybe it was the Lawn Ranger

4 Likes

Maybe this is the right thread for this realization that I had the other day. I was writing a Python function to use for a training course I’m giving:

def circle(radius):
    from math import pi
    area = pi * radius ** 2
    circumference = 2 * pi * radius
    return area, circumference

And I noticed a relationship between the area and the circumference that I hadn’t noticed before:
area = 1/2 * radius * circumference

And that led me to realize why that formula works. You can aproximate the area of a circle by inscribing an n-sided regular polygon in the circle. To calculate the area of the polygon, you can divide it into n isoceles triangles that have one corner at the center and two corners on the circle. Adding up the area of these triangles is n*(1/2)(altitude)*(p/n) = p *(1/2)*altitude, where p is the perimeter of the n sided polygon and altitude is the altitude of each triangle. As n approaches infinity, p converges to the circumference and altitude converges to r.

This seems pretty obvious now, but I never really thought about it that way. I wish it had been taught this way when I learned the formula in school.

Tldr: Area = 1/2 * Circumference * radius is much more intuitive than Area = pi * radius * radius

3 Likes

Importing inside a function? Is there a name clash you’re trying to avoid? Unpythonic I think, unless you have a good reason.

Doesn’t this make the function more modular by not assuming it has been imported elsewhere?

It’s no less efficient than putting it outside because the import will only run on the first function call.

Well, there are some reasons that don’t apply to “math”, which everyone will always have, but…

Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.

For a discussion:

https://www.reddit.com/r/Python/comments/acomr9/import_inside_functions/

Egregious grunch, but #8 applies to Trump’s doctor.

I think you do a very cool video/graphic on this if you start with a circle showing a radius and then unroll the circle splitting it apart at the radius. The bottom of the resulting shape would be the circumference, but the top would have no length because it would be just the center point of the circle. The shape would have to be torn up into a series of triangles for this to be true.

(I think, I’m not a math guy)

3 Likes

Goat radio

1 Like

@beetlejuice

loooool Boff, I got Madonna’s sister

uh good news, I booked Liberace’s wife!

1 Like

howard is killing it on the radio lately. like half the show is drilling home what a disaster trump has been for america

1 Like

and mark the bagger

takes shits at work
takes shits at work
takes shits at work
takes shits at work

2 Likes

remember when gary came on jimmy kimmel’s show to prove that he really CAN throw a pitch, and he beaned a woman in the audience who later died?

months later from unrelated causes, supposedly. but i’m sure the booey bean didn’t help

2 Likes

https://twitter.com/BoratSagdiyev/status/1315002188192575488

fuck, wednesday 10/7 episode was so fuckin good. this ronnie pile-on is epic

2 Likes

where do you get all the shows?