## Calculating distance (math prob.)

General FreeBASIC programming questions.
Oz
Posts: 585
Joined: Jul 02, 2005 14:21
Contact:
well, in my not-so-mathematical-keeping-it-simple, i consider 4d "3d animation" or time-frames.....

don't know much about "hypercubes" or such

Oz~
Thrawn89
Posts: 477
Joined: Oct 08, 2005 13:12
PROGRAMMING:
Ya, in programming most people inplement the 4th dimension as a frame index for a 3D movie. Or you could do it as temperature as someone pointed out before.

GEOMETRY:
In Mathematics/Geometry we define an object in n dimensions to be this:

We start with no dimensions, or an indefinite point in an indefinite void. Now to represent the next dimensional object on a 2D plane (paper) we take 2 objects from n and draw a line connecting all of the corrosponding vertices.

So lets say you have H0 above, you take two of them and draw a line segment with those as the endpoints, and you got a line, which is 1D...

Now you take 2 lines and draw a line to each endpoint and you got a plane which is 2D...

Now you take 2 planes and you connect the vertices then you got a cube which is 3D...

Now to get 4D you take 2 cubes and you connect the vertices to get 4D...
You do the same to get n+1 dimensions from n...Heres a better veiw of 4D:

PHYSICS:
Einstein proposed that there were 7 dimensions, of course there are other theories (string theory) that says that there are an infinite amount of dimensions...I will do Einstein's...

So we already know the 0 dimension all the way though to the 3rd dimension. (Indefinite point, line, plane, our dimension respectively)

Now if I remember his theories correctly that the universe can be modeled as 2 intersecting spheres, one of time, and one of space...Now we move constantly along the OUTSIDE surface of the spheres, and that is a strait line, yes we move in a STRAITLINE along the OUTSIDE edges of the spheres...

The fourth dimension is an object that can move THROUGH the INSIDE of the TIME sphere. Therefore, to an object moving along the outside edge, the 4D object will appear to be able to move through time.

The fifth dimension is like the fourth except you're moving THROUGH the INSIDE of the SPACE sphere. To an object moving along the outside of the sphere, the 5D object moving along the inside will appear to be able to instantaneously move from one location to another, but not through time, and vice versa for the 4D object. Now this is where the theory of wormholes come in, which is a part of space that bends to form a hole through to the 5th dimension. In a wormhole, a strait line is no longer the shortest distance between 2 points. This is the best thing to illustrate:

Where the purple is a strait line in our reality (3D) and the red is the wormhole. Dispite what u've seen on scifi stuff, wormholes dont have that gas spiral effect because there is no gravity sucking it in.

Now the 6th dimension is the same as the 4th and 5th however, you can go THROUGH where the time-space spheres INTERSECT. Therefore you can both go through time and space. Basically to a 3D person distance and time is not an obstical to a 6D object

Now I forgot the 7th, but oh well....

If anyone wants to elaborate on these, propose new theories (like the string), give the 7th, or correct me (which I believe I need cause its been a while since I read up on these) go ahead.

~Thrawn~
Thrawn89
Posts: 477
Joined: Oct 08, 2005 13:12
On one more note:
Because our space-time has dual wave-particle properties we move at a constant around the spheres at the speed of light, which is the speed where all electromagetic radiation moves at (the wave property part). But if we can get going faster than the speed of light in around time sphere relative to our universe, and can be at the same position in our space sphere, we can be able to get back to where we were BEFORE we left ^_^, something to think about...Einstein basically applied this to moving around the sun faster than the speed of light, you can move backwards through time.

~Thrawn~
E.K.Virtanen
Posts: 785
Joined: May 28, 2005 9:19
Location: Finland
Well, topic is hot so i add one thing here more.

I have an array(3600,3600,3600) and with FOR NEXT statements i check if distance from center is under size of "ball), then array(i,ii,iii) is one.

Longer distance, and array(i,ii,iii) is 0 and its "not allowed space)

This way there is an "space" in shape of 3d circle.

Now, when player enters on border of that space, should he/she turn around and start moving back, jump other side of space or what?

Sorry my very limited english.

Of course he/she should go to the next solar system, if speed allows it but im just studying these so ill stick on one solar system for now :)
jofers
Posts: 1525
Joined: May 27, 2005 17:18
Contact:
Well, a lookup table is nice, but a (3600,3600,3600) array of integers should take up over 18 gigabytes in memory. Perhaps instead you should just make sure the distance in 3d space is less than 1800 units?

The mechanics should work however you want. There have been games with both. I prefer jumping to the other side, as that allows the player to keep going, without yanking the controls and turning it around.

Unless you're just talking about physics. Once you exit the solar system, you'll just keep going for a few light years, that would translate into a very boring video game.
E.K.Virtanen
Posts: 785
Joined: May 28, 2005 9:19
Location: Finland
jofers wrote:Well, a lookup table is nice, but a (3600,3600,3600) array of integers should take up over 18 gigabytes in memory. Perhaps instead you should just make sure the distance in 3d space is less than 1800 units?

The mechanics should work however you want. There have been games with both. I prefer jumping to the other side, as that allows the player to keep going, without yanking the controls and turning it around.

Unless you're just talking about physics. Once you exit the solar system, you'll just keep going for a few light years, that would translate into a very boring video game.

ROFLMAO, yah. There is too much zeros on my array :D
I ment 360, not 3600.

Anyway, im just learning 3D arrays and im planning some kind of solar system viewer.
If i exit from system, i should hump to the next one but for now, im only planning one system viewer.
When "border" comes ahead, is it better to change angle and start returning from same direction where came from or just "jump" to ohterside of system.

I also think that it would be better to jump to other side of system. But just curious about others opinions.
Dr_D
Posts: 2430
Joined: May 27, 2005 4:59
Contact:
Or it could bounce off of the inside of the bounding sphere with something like this...

Code: Select all

`Distance = SQR((X2-X1)^2+(Y2-Y1)^2)+(Z2-Z1)^2))Radii = Radius1+Radius2If Distance<Radii Then    Pos.X -= (X2-X1)*Distance    Pos.Y -= (Y2-Y1)*Distance    Pos.Z -= (Z2-Z1)*DistanceEnd If`