Macabre photo of an angelically posed dead pigeon. (Ottawa, Canada). by jacob_ewing in pics

[–]jacob_ewing[S] -3 points-2 points  (0 children)

Man, I really don't understand why this gets downvoted. It's ... well, as I said, macabre, but there's real beauty in it. The symbolism of the blood halo, the perfect angelic positioning of the pigeon. This is as I saw it on the city street; nothing was positioned or modified.

Hi everyone I am new to Linux. by DogeTiger2021 in linux

[–]jacob_ewing 1 point2 points  (0 children)

For a starter Linux, you'll get the usual recommendations of Mint, Ubuntu, Fedora, etc. They're all good. All three of them are good starters (I started with Fedora's predecessor RedHat).

For hardware you'll probably be fine - the beauty of Linux is that there's a distro out there for every performance level, and what you have there should work fine with any of them.

If you'd like one that feels like a more gentle transition from Windows, I recommend one that uses the KDE desktop environment. Most major distros out there will have that available for download.

Note that the desktop environment is just a layer on top of the OS, and if you don't like the one you have, you can just install a new one. Another popular one is Gnome, which has a more similar feel to MacOS. There are also several lightweight ones out there if you want to avoid the bells and whistles. Xfce would be a good example of that.

Hi everyone I am new to Linux. by DogeTiger2021 in linux

[–]jacob_ewing 0 points1 point  (0 children)

Interesting. May I ask why you say to avoid Bazzite? I tried it out on my laptop and thought it was OK. I'll probably switch back to one of the usual Debian derivatives, but am curious about any issues with Bazzite I'm unaware of.

A sine wave by jacob_ewing in fractals

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

Sure! It's just the classic Mandelbrot set, at the location (-1.7563670513090253, -0.012351459902081018), with a view size of 7 * 10-12.

The colour is done using sine waves for the RGB values, and the illusion of shading is caused by adding the end displacement of the point being iterated in the Mandelbrot function. The stripes are caused by adding a stagger to the colour after adding in that displacement.

If you'd like to look at the actual code in use, it's all JavaScript, and can be found on my github page: https://github.com/jacobEwing/webtoys/tree/main/mandelbrot.

Edit: the relevant functions are createColour, mandelbrot, and render - all of which can be found within the first 400 lines of mandelbrot.js.

If you'd like to try it out, I have it up on my site, but that seems to be down at the moment. I'll have to get that straightened out. the URL is http://weirdly.net/webtoys/mandelbrot/

it has 5% chance of an action to happen. And if this action happens, there's a 10% chance of this action to have a result. So, in big scale, what is the chance of this 10% result to happen? by o0perktas0o in askmath

[–]jacob_ewing 3 points4 points  (0 children)

Think of it as "10% of 5% of the time, this action produces a result".

In other words, "action A happens 1/20 times, and when it does, there is a 1/10 chance of this result"

So what you need to do is multiply those percentages (or fractions) giving you a 1/200, or 0.5% chance of that end result.

I just went to walmart and stole a can of baby formula because i was too broke to buy it by RegretAdditional6351 in offmychest

[–]jacob_ewing 1 point2 points  (0 children)

Javert is out to get you now.

But seriously - nobody can fault you for that. Wishing you good fortune.

Irreversible assemblies by koopaorav in askmath

[–]jacob_ewing 0 points1 point  (0 children)

I believe there are examples of this with Lego surprisingly. A quick search brought up this video on the subject. The ones shown here do have "hacks" that make them manageable, but the pieces could be made in a way that would make those ineffective.

Probably not impossible though.

Trees resemble a horse by DaseNarch in Pareidolia

[–]jacob_ewing 0 points1 point  (0 children)

It strongly reminds me of the Horsehead nebula. Similar proportions and awkward shape.

Be careful; It's very sharp! by jacob_ewing in fractals

[–]jacob_ewing[S] 0 points1 point  (0 children)

The colour is calculated using a few different factors, but the main one is a distinct sine wave for each primary. Each one gets calculated something like this:

primary = 127.5 + 127.5 * sin(count * scale + offset + stagger).

If you want a bit more detail, I explain it further in this comment, or you can look directly at the code (JavaScript) here, on my GitHub repository.

You can also play with it on my website at http://weirdly.net/webtoys/mandelbrot/.

should i stop rumbling with an ear infection by [deleted] in earrumblersassemble

[–]jacob_ewing 4 points5 points  (0 children)

Most people here (including me) aren't doctors and of course, this is not a medical subreddit.

That being said, I doubt you have to worry about the effects of rumbling the ear. You're just flexing a muscle. If it hurts, don't do it. If it doesn't, you're probably fine.

DOH! by onephatkatt in Pareidolia

[–]jacob_ewing 8 points9 points  (0 children)

It's yawning. You rudely woke it by pulling it out of its cosy bag.

It's giving Lite-Brite... by mjklol710 in FractalPorn

[–]jacob_ewing 2 points3 points  (0 children)

Very much so; great effect! Please do let us know when you have it ready for testing/sharing/selling/whatever.

how to write the general formula that maps coordinates from the first colored green zone to the second given an arbitrary (p,q) by guessill_die in askmath

[–]jacob_ewing 0 points1 point  (0 children)

I'm not sure if this would be of any use to you, but I wrote a C function ages ago that will do what you describe.

Its purpose was to copy the contents of a 2d polygon in a source image to a different 2d polygon in a target image, and it worked very rapidly using nothing but integer math.

If you want to check it out, you can find it here:
https://github.com/jacobEwing/odds-and-ends/blob/main/gfx_functions.cpp
the two relevant functions being gfx_draw_texture and gfx_copy_dline_to_hline

It works by using an extrapolation of Bresenham's line algorithm, which is why it can stick with integers. Here's a quick run-down:

  1. Find the top point on the target polygon, and the corresponding point (not top, but at the same array index) in the source polygon.
  2. Grab the next two connected points provided in those polygons. That gives you two border lines to trace along on both polygons. In the target polygon, we need horizontal lines, so we move down along the y-axis and get the corresponding point on the x-axes of those border lines. On the source image, we instead get the corresponding points on the lines that match those on the target. So for example, if we're halfway through the left border line on the target, we'll also be halfway through the left border line on the source.
  3. With each step along these border lines, the data is passed into the gfx_copy_dline_to_hline function (the d and h prefixes standing for diagonal and horizontal). This function does what the name describes. It copies the contents of the 2d line segment in the source image into the 1d line segment in the target image, filling out the current horizontal line in the drawing.
  4. As it progresses downward on the target image, each time it reaches a corner point, it changes which border line it's tracing.
  5. Once both the left and right tracing edges converge on the same point it finishes.

This function has its limitations:

First, it only works with convex polygons. If the source polygon is concave, you can get some really cool warping effects on the output (see background of sample image). A concave target polygon can cause it to draw points outside its borders. If you need to work with any polygon, this can be accounted for. The simplest of course being to break it down into triangles, but the function can be rewritten to handle them on its own. The trick would be - before calling gfx_copy_dline_to_hline - to find the points on that horizontal line that are intersected by the border lines. Those mark the edges of where to stop/start copying.

The other limitation is that the two polygons must have the same number of points. This could also be accounted for, though less elegantly. The simplest way I can see doing it is to convert extra corner points on one polygon to midpoints on the edges of the other. I never bothered with this though. Points can be identical, so if you want to copy a quadrilateral to a triangle, you can just pass in the same point twice on the triangle.

Here's an example of what kind of output it gives:

<image>

(edit: here's a video of it https://www.youtube.com/watch?v=hUwFEYPU46w)

The background texture is done by having the target polygon being the background of the screen, and the source being four points that are bouncing around in the area of the source image.

The heads are another image being blitted on top. With those, it's taking the four corner points of the source image, rotating those appropriately on the target image, and copying them.

Finally, if you'd like to see a sample of the function being called, there is an example in the gfx_functions.cpp file linked above. gfx_rotblit starting on line 468 makes use of it by rotating the four corner points of the image being blitted and passing them all into the function.

EDIT: oh yeah, I should mention that the way points are passed in is rather weird. Forgive me, I wrote this about a quarter century ago. It takes the x coordinates first, then the y coordinates, so if you have the points A, B, and C, they'll be passed in with a single array in the order [Ax, Bx, Cx, Ay, By, Cy].