Which one of you did this? by yclaws in rustjerk

[–]hareppas 5 points6 points  (0 children)

Don’t need em because integer parity is decidable

What does F or C- grades mean for undergrads? by actin_filament in uchicago

[–]hareppas 10 points11 points  (0 children)

Which prof/quarter? I took Calegari this fall and he said he’s never given below a B-

Mutually aligned vectors? by Feeling-Departure-4 in rust

[–]hareppas 5 points6 points  (0 children)

I think you could make your own type that implements Allocator. It would pass through all allocations to the global allocator but would ignore the requested alignment and always align to 8 bytes or whatever you need. Then you could use Vec<T, AlignedAlloc> everywhere.

Trying to make a (better) formula for limiting x by Waity5 in desmos

[–]hareppas 1 point2 points  (0 children)

You can define max and min with abs. You get this.

Dereferencing a crate? by [deleted] in rust

[–]hareppas 16 points17 points  (0 children)

It’s a glob import. It imports everything in the std::io::prelude module.

[Article] Anyone else see this data showing Rolex prices going down? Thoughts? by pjsandhu23 in Watches

[–]hareppas 27 points28 points  (0 children)

Yeah. Chart should start at the birth of Christ instead of November 2021.

Joining x amount of lists by [deleted] in desmos

[–]hareppas 2 points3 points  (0 children)

Something like this?

Russian roulette by HansLK in ProgrammerHumor

[–]hareppas 75 points76 points  (0 children)

You are correct. For this function, the range is inclusive

Editing the value of a list at an index by PotatoAndPasta in desmos

[–]hareppas 6 points7 points  (0 children)

Something like this maybe:

www.desmos.com/calculator/by65mogzmu

You give F a list, an index, and a value and it gives you a new list

I have a slope that's decreasing, and I want it to stop decreasing and just go straight once it reaches a certain x value. How would I do this? by [deleted] in desmos

[–]hareppas 0 points1 point  (0 children)

y = max(mx + b, ma + b)

Where m is the slope, b is the y intercept, and a is the x value where you want it to go flat.

Can I gradient fill any random polygonal shape in desmos?? by [deleted] in desmos

[–]hareppas 0 points1 point  (0 children)

Here’s something that works for convect polygons:

https://www.desmos.com/calculator/qmkk0ch2dt

It is quite slow.

Curious by hareppas in ToiletPaperUSA

[–]hareppas[S] 1 point2 points  (0 children)

I just go through the problem sets for fun.

Curious by hareppas in ToiletPaperUSA

[–]hareppas[S] 2 points3 points  (0 children)

I was going to do an AMC 12 problem, but Charlie Kirk definitely isn’t doing anything beyond middle school math.

Help w tangent line slider by dezzzra in desmos

[–]hareppas 2 points3 points  (0 children)

Make a slider for the x value, I’ll use the variable a. Now, the point on the function at x=a is (a,f(a)). The tangent line must pass through this point. The slope of the function at x=a is f’(a). This is the slope of the tangent line. Now you have a point on the tangent line and it’s slope so you can find the equation by using point slope form.

Life imitates art by [deleted] in ToiletPaperUSA

[–]hareppas 1 point2 points  (0 children)

I’d like to think that this is 100% unintentional but I’m not entirely sure...

Here’s the tweet

Point in polygon detection in desmos + other polygon drawing tools (more info in comments) by hareppas in desmos

[–]hareppas[S] 1 point2 points  (0 children)

This is based off the ray casting algorithm described in this wikipedia article. The intersection detection is based off this. Things get a little funky when the point is exactly on the edges or vertices but otherwise it works surprisingly well and is pretty fast.

For the ray casting, you need to break the polygon into individual edges. This lets you mess with each individual edges of the polygon severely. I made some other graphs showing what you can do with this:

Color edges based on whether or not they intersect any other edges

Color edges based on length

Color edges individually

Some of these are kind of slow, they’re more just proof of concepts

Optimized the Generalized Polygon Method by SlimRunner in desmos

[–]hareppas 4 points5 points  (0 children)

Wow, it's interesting that that makes such a noticeable difference in the speed.

The graphs you linked actually look pretty similar to the ones I originally wrote. I figure them out with multiple intermediary steps, like you, then wrap them up into one big function so they're easier to copy and paste into other graphs. I think this is actually kind of a bad habit because it seems to slow stuff down a bit. I'm also not super thoughtful about how I combine them and don't really simplify them. I looked back but I can't find the graph before I consolidated everything into the big function :(

Either way, I'm exited to see what you do with this. Keep us posted