POV-Ray : Newsgroups : povray.general : gravity well : Re: gravity well Server Time
4 May 2024 16:01:18 EDT (-0400)
  Re: gravity well  
From: alphaQuad
Date: 11 Oct 2007 14:45:00
Message: <web.470e6e8950ab97d7e52dcb710@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> alphaQuad nous apporta ses lumieres en ce 2007/10/10 17:30:
> >
> > Why does Mike say this is the function for a gravity well?
> > x*x - 0.002/y*y + z*z
> >
> > Or more importantly what must be done that I am not doing to render a
> > surface as Mike has here:
> > http://www.econym.demon.co.uk/isotut/more.htm
> >
> >
>
> Gravity is a function of the sum of the mass involved divided by the square of
> the distance. g = (M1 + M2)/R^2

Anyone who has tried to make a grav-model with the textbook r^2 has probably
been frustrated.

Actually g*m1*m2/inversesquare of the distance
OR
g/r^3
and the g is model dependent as in scale input

I'll reference 2 working models.
Here in my opengl model:

SUBVECTORS(v1,planets[i].pos,planets[nrbd].pos);
frc = G / pow(MODULE(v1),3);
MULTVECTOR(v1, v1, frc);
ADDVECTORS(planets[i].gvel,planets[i].gvel,v1);


And another:

  var %s = $calc((%d.x ^ 2) + (%d.y ^ 2))
  var %force = $calc(-200 / (%s * $sqrt(%s)))
  inc %vx $calc(%d.x * %force)
  inc %vy $calc(%d.y * %force)
  inc %px %vx
  inc %py %vy


Here d is a 2d vector:

  dist2 = d.x*d.x + d.y*d.y
  dist = sqrt(dist2)
  dist2 * sqrt(dist2) = the inverse square of the dist == pow(dist,3)


And run the numbers

  dist = 228.53664913969487
  dist2 = 52229 (-223 * -223 + -50 * -50)

  (52229 * $sqrt(52229)) ====== 11936240.640621
  pow(228.53664913969487,3) = 11936240.647917


  $vlen2($subv2(%tri.a,%tri.b)) = 228.53664913969487
  %tri.a 394 126
  %tri.b 617 176




> The gravity well is the 4D deformation of space due to the gravity of any
> object. The resulting 4D shape is then projected into 3D space in the form of a
> bent surface, the 3D space been flatened to 2D and the 4D deformation flatened
> in 3D. The proposed function is the end result of that projection.
>
> The -0.002 is an arbitrary ponderation factor.
>
> The proposed shape is for a punctual mass, whitch is an acceptable
> simplification in most cases and the actual situation in the case of a black hole.

interesting but doesnt get us much closer to working code.
thanks for the input.
>
> --
> Alain
> -------------------------------------------------
> You know you've been raytracing too long when you downloaded and printed the
> Renderman Interface documentation, so you'd have a little light reading to take
> on holiday.
> Alex McLeod a.k.a. Giant Robot Messiah


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.