FreshRSS

Zobrazení pro čtení

Jsou dostupné nové články, klikněte pro obnovení stránky.

The Geometric Tool That Solved Einstein’s Relativity Problem

After Albert Einstein published his special theory of relativity in 1905, he spent the next decade trying to come up with a theory of gravity. But for years, he kept running up against a problem. He wanted to show that gravity is really a warping of the geometry of space-time caused by the presence of matter. But he also knew that time and distance are counterintuitively relative: They change...

Source

Grad Students Find Inevitable Patterns in Big Sets of Numbers

In late 2017, Ashwin Sah and Mehtaab Sawhney met as undergraduates at the Massachusetts Institute of Technology. Since then, the pair have written a mind-boggling 57 math proofs together, many of them profound advances in various fields. In February, Sah and Sawhney announced yet another joint accomplishment. With James Leng, a graduate student at the University of California, Los Angeles...

Source

How Does Math Keep Secrets?

Can you keep a secret? Modern techniques for maintaining the confidentiality of information are based on mathematical problems that are inherently too difficult for anyone to solve without the right hints. Yet what does that mean when quantum computers capable of solving many problems astronomically faster are on the horizon? In this episode, host Janna Levin talks with computer scientist Boaz...

Source

Collision of two rigid spheres with spin

I'm trying to create a particle simulation (solar system kind). Until now my particles have no spin so the collision is rather simple

    void collide(const Particle& b) {
        const Vector3d normal = math::normal(position(), b.position());
        const Vector3d relativeVelocity = velocity() - b.velocity();
        const double dot = math::dot(relativeVelocity, normal);
        const Vector3d work = normal * dot;

        _velocity = _velocity - work;
    }

Since I've read that particle spin plays a huge part in such simulations I'm trying to implement angular momentum but unfortunately this exceeds my math skills. I tried searching the internet for quite a while now for any source I understand but I'm at the brink of giving up.

How can I integrate particle spin into my code? I can work with any kind of (pseudo) code as long as the variables are somewhat clear. Particles are rigid spheres with mass = volume.

Edit: Dont get hang up on what the simulation is trying to achieve. The task can be simplified down to: Two rigid spheres collide in space. Calculate their motion and spin after the collision.

How Does Math Keep Secrets?

Can you keep a secret? Modern techniques for maintaining the confidentiality of information are based on mathematical problems that are inherently too difficult for anyone to solve without the right hints. Yet what does that mean when quantum computers capable of solving many problems astronomically faster are on the horizon? In this episode, host Janna Levin talks with computer scientist Boaz...

Source

How to live on sphere?

What I want to achieve

I want to generate sphere planet world, seamless of course, for RTS game like Planetary Annihilation: TITANS, which means I want:

  • place walking agents on sphere, move them on a sphere surface, be able to do A* pathfinding
  • generate polygonal regions on sphere like Voronoi
  • have world divided by chunks (possibly reduced to 1D array) to effectively perform calculations like local avoidance.
  • generate seamless surface heightmap based on noise functions AND not to store this height map as a texture but just store height overrides in chunks. This way I can have just uint seed and overrides instead of keeping huge heightmap texture.

How would I do it in seamless 2D world

In 2D space things are really simple even if your world one axis seamless: 2D map can be imagined as cylinder, or both axis are seamless: 2D map can be imagined as torus. enter image description here

Coordinates

They are just float x, y. Moving is just adjusting coordinates. Distance between 2 points is just distance between 2D vectors. Seamlessness of moving is achieved by % operation with coordinates, like x = x % x_max.

World as 2D grid

2D world can be represented as 2D grid where each cell is a chunk with which I can effectively store and access data, because 2D grid is reduced to 1D array. 2D position can be easily converted to chunk index and back.

Heightmap noise generation

Seamless noise can be tricky, but here we have golden treasure of map noise generation from red blob games.

Presenting world and LOD

I would use simple plane mesh with rectangular connection of triangles to represent terrain of 2D world. LOD then could be implemented by recursively add vertices into mesh cells like tree. Again with 2D world it is simple because mesh / data / LOD are all grid based.

Problems of doing same with sphere world

Because claimed / x-seamless / xy-seamless 2D worlds are all not really the sphere (they are plane / cylinder / torus in terms of wrapping) there can't be 1:1 transformation between 2D and spherical 2D world.

When trying to wrap rectangular around sphere something should be disturbed. It could be that we actually run all logic in 2D but project coordinates on sphere, but we will get disturbed positions near poles. enter image description here

Or we can run logic on sphere and project positions back to 2D then we will get disturbed 2D representation like what happens with earth map when it represented in 2D, which is what called Equirectangular projection. enter image description here

One way or another I need some "grid" representation of chunks, because in the end I need to test what chunks of sphere camera see and effectively cull objects which are not in visible chunk.

Cubemap solution

Representing sphere as cubemap kills all problems working with sphere, because sphere now represented as 6 2D grids.

  • Constructing mesh is just get cube (or six plane faces) with vertices adjusted in a way they lay on unit sphere. LOD is now also possible because we can work with faces separately.
  • Store and access needed chunk now isn't a problem also because now we are back on 2D grids. enter image description here

Problem with cubemap coordinate system

Many thanks again to red blob games and this article in particular. Here we can find a way to implement coordinate system for cubemap world. But moving across faces is a huge mess, not only because it require to map direction for each face but also because when both x and y have to be wrapped to another face it becomes ambiguous which face to choose. So moving on cube map becomes problematic for corner cases.

Use cubemap only for data

I think it is possible to use spherical coordinate system latitude and longitude and reimplement common operations like moving, getting distance, etc. but on sphere instead of 2D surface and use cubemap representation only for storing data in and read from chunks.

Where to live finally?

  • Living on sphere means to deal with spherical calculations which are more complex to understand and expensive because require trigonometrical functions. But then coordinate system becomes natural because we actually live on sphere and just map it on cubemap when need to work with rectangular chunks.
  • Living on cubemap means to deal with cubemap coordinate system which is complex core of all this approach also producing prohibited moving cases. But in return we get nice and simple 2D calculations for everything with natural storing data in rectangular chunks and only use sphere to represent our world in 3D as a planet.

What I want as an answer

Maybe I already answered my question and there is no place to answer anymore and I just need to chose one way or another comparing pros and cons. But maybe I miss something, maybe there is another smart way to do what I need without overcomplicating everything. I will appreciate any advice.

How do splines work?

I've been beginning to work with different kinds of splines (e.g. Bezier, Hermite, B-splines) in some of my work with computer graphics and I am trying to get a grasp of how they work (mathematically and programmatically). I know that generally (at least for cubic splines), you will have 4 control points that influence the position of points along an interpolated line. For example, with Bezier curves (as far as I understand), there can be two end points where the line will begin and terminate and two control points that influence the direction of the line.

I've been programming Bezier, Hermite, and B-Splines (in javascript on an html5 canvas) and what I don't understand is how to choose these 4 points in order to see a specific curve rendered on the screen. So far, I have only been able to render at least part of a curve by randomly playing around with different numbers for each point.

This is one of the many questions I have about the inner workings of splines so could someone provide an overview on how they work and how they can be programmed (most of the examples online are more theoretical and rather unspecific)?

How the Square Root of 2 Became a Number

The ancient Greeks wanted to believe that the universe could be described in its entirety using only whole numbers and the ratios between them — fractions, or what we now call rational numbers. But this aspiration was undermined when they considered a square with sides of length 1, only to find that the length of its diagonal couldn’t possibly be written as a fraction. The first proof of this...

Source

How Is Science Even Possible?

The universe seems like it should be unfathomably complex. How then is science able to crack fundamental questions about nature and life? Scientists and philosophers alike have often commented on the “unreasonable” success of mathematics at describing the universe. That success has helped science probe some profound mysteries — but as the physicist Nigel Goldenfeld points out, it also helps that...

Source

Predictive Aim to shoot a moving target with a constant velocity while the projectile is affected by gravity (2D/Platformer view)

I've been working on creating stationary gun turrets that can shoot down missiles in my game. The bullets are affected by gravity while the missile moves in a linear path at a constant rate as if it had no acceleration or gravity. A turret shooting bullets in a parabolic curve at a missile moving in a straight path

Here is the math for the prediction My math is most likely wrong because it doesnt work even after I've tweaked and changed a few things.

Could someone please explain the derivation of the correct formula?

How to make an object keep same relative position and orientation using only velocity

I have object A, I can get any information I want from object A (global position, velocity, etc)

I have object B, which is positioned and oriented in a certain way relative to object B. There is no parent/child relation between the 2 objects. I can't change the global position of object B, nor can I simply translate or rotate it. The only thing I can do is set the angular and linear velocities.

Is there a way for me to keep the relative position and orientation of object B when object A moves, while using only velocity? I've tried using what I could find online (including ChatGPT), but nothing seems to work. (i'm in 3D)

(Edit: after a comment, here is an example to clarify: object A can be a human character and object B his a Backpack. When the character moves, you want the backpack to remain on his back. Normally this is easily done with matrix transforms but in this case, we need to move the backpack only by controlling its angular and linear velocities)

In Highly Connected Networks, There’s Always a Loop

As mathematical abstractions go, graphs are among the simplest. Scatter a bunch of points in a plane. Connect some of them with lines. That’s all a graph is. And yet they are incredibly powerful. They can be used to attack a wide variety of problems, from modeling neurons in the brain to routing delivery trucks on the roads. Within math, they can be used to categorize important algebraic objects...

Source

Mathematicians Attempt to Glimpse Past the Big Bang

About 13.8 billion years ago, the entire cosmos consisted of a tiny, hot, dense ball of energy that suddenly exploded. That’s how everything began, according to the standard scientific story of the Big Bang, a theory that first took shape in the 1920s. The story has been refined over the decades, most notably in the 1980s, when many cosmologists came to believe that in its first moments...

Source

Strangely Curved Shapes Break 50-Year-Old Geometry Conjecture

In an old Indian parable, six blind men each touch a different part of an elephant. They disagree about what the elephant must look like: Is it smooth or rough? Is it like a snake (so thinks the man touching the trunk) or a fan (as the man touching the ear proposes)? If the blind men had combined their insights, they might have been able to give a correct account of the nature of the elephant.

Source

The view matrix finally explained

I must say that I am really confused by how a view matrix is constructed and works.

First, there are 3 terms: view matrix, lookat matrix, and camera transformation matrix. Are those 3 the same, or different things. From what I undestand, the camera transformation matrix is basically the model matrix of the camera, and the view matrix is the inverse of that. The lookat matrix is basically for going from world space to view space, and I think I undestand how it works (doing dot products for projecting a point into another coordinate system).

I am also confused by the fact that sometimes, it seems like the view matrix is built by translation and dot products, and some other times, it is built with translation and rotation (with cos and sin).

There are also quaternions. When you convert a quaternion to a matrix, what kind of matrix is this?

Can someone explain to me how it really works, or point me towards a good resource.

Thank you.

A Rosetta Stone for Mathematics

In 1940, from a jailhouse in Rouen, France, André Weil wrote one of the most consequential letters of 20th-century mathematics. He was serving time for refusing to join the French army, and he filled his days in part by writing letters to his sister, Simone, an accomplished philosopher living in London. In a previous letter, Simone had asked André to tell her about his work. With war all around...

Source

C#, Split a number x into y parts with a min and max part_size [closed]

For a game I need to split a number into random parts, where the parts have lower and upper limits. (a precheck will ensure that a split is possible)

Example: Number:10, Parts:5, MinSize:1, MaxSize:3
Split(10,5,1,3) => 3,3,2,1,1
Split(10,5,1,3) => 1,2.5,3,1.5,2

I started with:

Foreach Part => Rand(MinSize,MaxSize)
Then I scale all the parts, so that the sum is equal to the number.
BUT, the simple scaling will possibly set parts outside the limits.

Is there a simple implementation with C#?

(For simplicity, the number could be 1 and the limits respectively smaller)
The result of 10,5,1,3 could be scaled from 1,5,0.1,0.3

Greetings, Mech

Randomization algorithm that trades between more variance and higher total value

I need to generate discrete integer variables that each have meaning, so does their sum. I am essentially looking to partition a normal distribution into n bins. You can think of them as stats. The total obviously matters, but if we always equally distribute them, an item with higher total stats would be strictly better than one with lower total. We can't have that. Therefore, I had the idea to "reward" the player with bigger variation if the generated sum is low. I just do not know how to achieve this.

Generating a total value from a normal distribution is easy. However, I don't know how to distribute them in the way I described. Below are methods I have tried:

  1. Start with an equal partition, for a random number of steps, increase a random stat by 1 and decrease another by 1. Problem: the values always seem to be stuck near the beginning.

  2. Start with an equal partition that is higher than the desired average. For a random number of steps, increase a random stat by 1 an decrease all others by 1. Problem: this seems to just universally lower all the stats without producing the variation I wanted. The sum total is also not normally distributed.

  3. Randomly generate the first (n-1) variables from normal distributions, and fix the last one. Problem: this produces very predictable results. Each sample looks more or less the same.

Is there an algorithm that achieves this except just to generate many samples until it has the desired distribution?

A Rosetta Stone for Mathematics

In 1940, from a jailhouse in Rouen, France, André Weil wrote one of the most consequential letters of 20th-century mathematics. He was serving time for refusing to join the French army, and he filled his days in part by writing letters to his sister, Simone, an accomplished philosopher living in London. In a previous letter, Simone had asked André to tell her about his work. With war all around...

Source

To Pack Spheres Tightly, Mathematicians Throw Them at Random

Mathematicians like to generalize concepts into higher dimensions. Sometimes this is easy. If you want to efficiently pack squares in two dimensions, you arrange them like a checkerboard. To squeeze together three-dimensional cubes, you stack them like moving boxes. Mathematicians can easily extend these arrangements, packing cubes in higher-dimensional space to perfectly fill it.

Source

Mathematicians Marvel at ‘Crazy’ Cuts Through Four Dimensions

The central objects of study in topology are spaces called manifolds, which look flat when you zoom in on them. The surface of a sphere, for instance, is a two-dimensional manifold. Topologists understand such two-dimensional manifolds very well. And they have developed tools that let them make sense of three-dimensional manifolds and those with five or more dimensions. But in four dimensions...

Source

Geometers Engineer New Tools to Wrangle Spacecraft Orbits

In October, a Falcon Heavy rocket is scheduled to launch from Cape Canaveral in Florida, carrying NASA’s Europa Clipper mission. The $5 billion mission is designed to find out if Europa, Jupiter’s fourth-largest moon, can support life. But because Europa is constantly bombarded by intense radiation created by Jupiter’s magnetic field, the Clipper spacecraft can’t orbit the moon itself. Instead...

Source

Elliptic Curve ‘Murmurations’ Found With AI Take Flight

Elliptic curves are among the more beguiling objects in modern mathematics. They don’t seem complicated, but they form an expressway between the math that many people learn in high school and research mathematics at its most abstruse. They were central to Andrew Wiles’ celebrated proof of Fermat’s Last Theorem in the 1990s. They are key tools in modern cryptography. And in 2000...

Source

‘Entropy Bagels’ and Other Complex Structures Emerge From Simple Rules

Repetition doesn’t always have to be humdrum. In mathematics, it is a powerful force, capable of generating bewildering complexity. Even after decades of study, mathematicians find themselves unable to answer questions about the repeated execution of very simple rules — the most basic “dynamical systems.” But in trying to do so, they have uncovered deep connections between those rules and other...

Source

Quanta Relaunches Hyperjumps Math Game

It’s the year 2718. Humanity has invented a warp drive that enables a spacecraft to hyperjump to distant solar systems and back to Earth. The drive promises to revolutionize space exploration. But there’s a catch. The new technology can only make hyperjumps that follow the basic rules of arithmetic. Earth’s governing body has tapped you, an adventurous math explorer, to captain the first warp...

Source

Unfolding the Mysteries of Polygonal Billiards

In Disney’s 1959 film Donald in Mathmagic Land, Donald Duck, inspired by the narrator’s descriptions of the geometry of billiards, energetically strikes the cue ball, sending it ricocheting around the table before it finally hits the intended balls. Donald asks, “How do you like that for mathematics?” Because rectangular billiard tables have four walls meeting at right angles...

Source

Quanta Relaunches Hyperjumps Math Game

It’s the year 2718. Humanity has invented a warp drive that enables a spacecraft to hyperjump to distant solar systems and back to Earth. The drive promises to revolutionize space exploration. But there’s a catch. The new technology can only make hyperjumps that follow the basic rules of arithmetic. Earth’s governing body has tapped you, an adventurous math explorer, to captain the first warp...

Source

Unfolding the Mysteries of Polygonal Billiards

In Disney’s 1959 film Donald in Mathmagic Land, Donald Duck, inspired by the narrator’s descriptions of the geometry of billiards, energetically strikes the cue ball, sending it ricocheting around the table before it finally hits the intended balls. Donald asks, “How do you like that for mathematics?” Because rectangular billiard tables have four walls meeting at right angles...

Source

❌