![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 14:45:16
Message: <4d71414c@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Kevin Wampler <wam### [at] u washington edu> wrote:
> def genTorusPoints(major, minor, usteps, vsteps, rsteps):
> for i in xrange(usteps):
> for j in xrange(vsteps):
> for k in xrange(rsteps):
> u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
> x = (major+r*minor*cos(v))*cos(u)
> y = (major+r*minor*cos(v))*sin(u)
> z = r*minor*sin(v)
> m = r*sqrt(x*x+y*y)
> yield x, y, z, m
The density will not be equal because the points will be distributed more
densely deeper inside the torus than closer to the surface, without the
correspondent scaling of the mass.
As for taking into account the distance from the center on the mass, are
you sure that it's proportional to 'r' and not 'r*r'?
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Kevin Wampler
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 17:29:56
Message: <4d7167e4$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 3/4/2011 11:45 AM, Warp wrote:
> Kevin Wampler<wam### [at] u washington edu> wrote:
>> def genTorusPoints(major, minor, usteps, vsteps, rsteps):
>> for i in xrange(usteps):
>> for j in xrange(vsteps):
>> for k in xrange(rsteps):
>> u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
>> x = (major+r*minor*cos(v))*cos(u)
>> y = (major+r*minor*cos(v))*sin(u)
>> z = r*minor*sin(v)
>> m = r*sqrt(x*x+y*y)
>> yield x, y, z, m
>
> The density will not be equal because the points will be distributed more
> densely deeper inside the torus than closer to the surface, without the
> correspondent scaling of the mass.
Since r=0 for points in the center of the `tube' and r=1 for points on
the surface, points deeper inside the torus are indeed given less mass.
> As for taking into account the distance from the center on the mass, are
> you sure that it's proportional to 'r' and not 'r*r'?
>
I'm not sure what you mean by "the center" here, but I do think that r
is correct in this case. You can think of the case of a cylinder
instead of a torus. Here, the volume of a `wedge' increases as you move
further away from the central axis, but only the volume only grows
linearly. Intuitively this is because only one of its three dimensions
grows as you move further out, but you can prove if you want by looking
at the volume of a fixed fraction of a cylindrical ring of constant
thickness as its radius increases.
We actually have a torus and not a cylinder, and the sqrt(x*x+y*y) term
takes into account the change in density due to the distance from the
torus' axis. The resulting equation is bilinear, which is maybe where
you got the intuition that it should be quadratic from.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 17:50:14
Message: <4d716ca5@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Kevin Wampler <wam### [at] u washington edu> wrote:
> On 3/4/2011 11:45 AM, Warp wrote:
> > Kevin Wampler<wam### [at] u washington edu> wrote:
> >> def genTorusPoints(major, minor, usteps, vsteps, rsteps):
> >> for i in xrange(usteps):
> >> for j in xrange(vsteps):
> >> for k in xrange(rsteps):
> >> u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
> >> x = (major+r*minor*cos(v))*cos(u)
> >> y = (major+r*minor*cos(v))*sin(u)
> >> z = r*minor*sin(v)
> >> m = r*sqrt(x*x+y*y)
> >> yield x, y, z, m
> >
> > The density will not be equal because the points will be distributed more
> > densely deeper inside the torus than closer to the surface, without the
> > correspondent scaling of the mass.
> Since r=0 for points in the center of the `tube' and r=1 for points on
> the surface, points deeper inside the torus are indeed given less mass.
I misintepreted the meaning of 'r'.
> I'm not sure what you mean by "the center" here, but I do think that r
> is correct in this case. You can think of the case of a cylinder
> instead of a torus. Here, the volume of a `wedge' increases as you move
> further away from the central axis, but only the volume only grows
> linearly. Intuitively this is because only one of its three dimensions
> grows as you move further out, but you can prove if you want by looking
> at the volume of a fixed fraction of a cylindrical ring of constant
> thickness as its radius increases.
The two outer loops are subdividing the torus into pyramid-shaped
volumes (with the apex at the center of the "tube" and the base at
the surface of the torus). The inner loops then subdivides this pyramid
into parts from apex to base at even steps.
Two of the dimensions (those defined by 'u' and 'r') of these parts
remain the same, while one dimension (the one defined by 'v') increases
linearly. I suppose this means you are right: The volume of these parts
increases linearly, not quadratically. (Well, technically speaking not
really. In a cylinder they would, but in the torus it depends on which
way the pyramid is pointing to: If it's pointing towards the center of
the torus, it gets narrower towards the base, while on the other direction
it gets wider. But that's what the "sqrt(x*x+y*y)" part is addressing...)
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> One way to numerically approximate the result would be to fill the torus
> with point masses and then sum up their gravity on the tested location.
> If we assume that the torus has even density, filling it up with point
> masses is actually non-trivial.
I would have thought the easiest and trivial way is to just sample the
3D volume containing the torus in a regular grid pattern. Kind of like
creating a volume texture of the torus. You can then divide the total
mass by the number of points "inside" to figure the mass of each point
for use in the calculations. Just choose a resolution good enough for
the accuracy you require.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> In another forum I was pondering about the gravity field of a torus
> (ie. imagine you had eg. a torus-shaped planet: What would be the direction
> and strength of gravity at different points on its surface?)
>
> Two possibilities were suggested: The analytical (and thus exact) way,
> which would require solving a complicated volume (ie. triple) integral,
> and numerical approximation.
>
> The numerical approximation is simpler in principle, but there are some
> difficulties.
>
> One way to numerically approximate the result would be to fill the torus
> with point masses and then sum up their gravity on the tested location.
> If we assume that the torus has even density, filling it up with point
> masses is actually non-trivial.
>
> There are two possibilities:
>
> 1) All the point masses have the same mass (ie. the total mass of the
> torus divided by the number of points) and are distributed evenly inside
> the torus. This is a bit problematic because coming up with an even
> distribution of points inside a torus is not easy. Basically it would
> mean that you would have to divide the torus into polyhedrons of the
> same volume, and put the point masses at their center. However, subdividing
> a torus into polyhedrons of the same volume is not trivial.
>
> 2) Instead, we subdivide the torus into polyhedrons of arbitrary size
> and scale the mass of the points in relation to the volume of the polyhedron.
> (In other words, the masses are scaled according to the local point
> density.)
>
> The second option might be the easiest to do, as it allows for a simple
> distribution function for the points which does not need to be strictly
> even.
>
> The easiest division of the torus would be to divide it into slices,
> each slice is divided into sections (each such section would thus
> effectively be a pyramid with the base on the surface of the torus and
> the apex on the central major-radius circle of the torus), and then each
> section into polyhedrons (from the base towards the apex of the pyramid).
>
> One way to easily achieve this programmatically is to simply create
> points on the surface of toruses of increasing minor radius (the major
> radius being the same as the original torus we are dealing with).
>
> The problem is deciding what the mass of these points should be. As said,
> they can't have equal mass because else you would end up with very uneven
> density (the torus would be significantly denser deep inside and less
> dense closer to the surface).
>
> If we think about the points inside one of the slices, the masses should
> be, if I understand correctly, proportional to the square of the distance
> from the center. This gives you a disc of even density. (However, I'm not
> sure now if there should be a constant factor involved...)
>
> However, that alone is not enough. There's another aspect that has to
> be considered: The points would be distributed less densely on the outer
> rim of the torus and more densely on the inner rim. Thus they have to be
> also scaled according to their distance from the center of the torus.
> I'm not exactly sure what the formula would be.
>
> Since we want the entire torus to have a certain mass m, the sum of
> all the point masses have to be that. However, that's actually trivial:
> Simply use whatever values are most convenient to create the points, and
> then just divide by the sum of the original masses and multiply by m.
>
> However, the exact formulas to determine the masses of the points is
> a bit fuzzy to me. Perhaps someone could help a bit?
>
Some things to consider:
When in the hole of the torus, the gravity is only toward the plane
perpendicular to the major radius. On that plane, the gravity is zero.
Everywhere on the torus surface, gravity is biased toward the major axis.
Gravity is highest at the exterior equator and null at the interior equator.
The athmosphere would take the shape of an oblate sphere. It's thickness
would make the inside areas very dark. The iner "tropical" region could
very well be in perpetual total darkness, but relatively warm.
Alain
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> In another forum I was pondering about the gravity field of a torus
> (ie. imagine you had eg. a torus-shaped planet: What would be the direction
> and strength of gravity at different points on its surface?)
>
> Two possibilities were suggested: The analytical (and thus exact) way,
> which would require solving a complicated volume (ie. triple) integral,
> and numerical approximation.
>
> The numerical approximation is simpler in principle, but there are some
> difficulties.
>
> One way to numerically approximate the result would be to fill the torus
> with point masses and then sum up their gravity on the tested location.
> If we assume that the torus has even density, filling it up with point
> masses is actually non-trivial.
>
> There are two possibilities:
>
> 1) All the point masses have the same mass (ie. the total mass of the
> torus divided by the number of points) and are distributed evenly inside
> the torus. This is a bit problematic because coming up with an even
> distribution of points inside a torus is not easy. Basically it would
> mean that you would have to divide the torus into polyhedrons of the
> same volume, and put the point masses at their center. However, subdividing
> a torus into polyhedrons of the same volume is not trivial.
>
> 2) Instead, we subdivide the torus into polyhedrons of arbitrary size
> and scale the mass of the points in relation to the volume of the polyhedron.
> (In other words, the masses are scaled according to the local point
> density.)
>
> The second option might be the easiest to do, as it allows for a simple
> distribution function for the points which does not need to be strictly
> even.
>
> The easiest division of the torus would be to divide it into slices,
> each slice is divided into sections (each such section would thus
> effectively be a pyramid with the base on the surface of the torus and
> the apex on the central major-radius circle of the torus), and then each
> section into polyhedrons (from the base towards the apex of the pyramid).
>
> One way to easily achieve this programmatically is to simply create
> points on the surface of toruses of increasing minor radius (the major
> radius being the same as the original torus we are dealing with).
>
> The problem is deciding what the mass of these points should be. As said,
> they can't have equal mass because else you would end up with very uneven
> density (the torus would be significantly denser deep inside and less
> dense closer to the surface).
>
> If we think about the points inside one of the slices, the masses should
> be, if I understand correctly, proportional to the square of the distance
> from the center. This gives you a disc of even density. (However, I'm not
> sure now if there should be a constant factor involved...)
>
> However, that alone is not enough. There's another aspect that has to
> be considered: The points would be distributed less densely on the outer
> rim of the torus and more densely on the inner rim. Thus they have to be
> also scaled according to their distance from the center of the torus.
> I'm not exactly sure what the formula would be.
>
> Since we want the entire torus to have a certain mass m, the sum of
> all the point masses have to be that. However, that's actually trivial:
> Simply use whatever values are most convenient to create the points, and
> then just divide by the sum of the original masses and multiply by m.
>
> However, the exact formulas to determine the masses of the points is
> a bit fuzzy to me. Perhaps someone could help a bit?
>
Start with 2 points placed at the major radius.
Draw 2 circles of minor radius.
Calculate the 2D influence for those 2 circles.
Rotate around the major axis.
This assume that the density is constant.
It resolves to a static 2 body gravitic interaction.
Alain
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Le Forgeron
Subject: Re: Numerical approximation of the gravity of a torus
Date: 8 Mar 2011 11:13:53
Message: <4d7655c1$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 08/03/2011 16:48, Alain a écrit :
> Gravity is highest at the exterior equator and null at the interior
> equator.
I would question that second part for a demonstration.
Null at the center, ok.
Highest on the exterior equator, ok.
But null at the interior equator, it might depend on major & minor radius.
--
Software is like dirt - it costs time and money to change it and move it
around.
Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 2011/03/08 11:13, Le_Forgeron a écrit :
> Le 08/03/2011 16:48, Alain a écrit :
>> Gravity is highest at the exterior equator and null at the interior
>> equator.
>
> I would question that second part for a demonstration.
>
> Null at the center, ok.
> Highest on the exterior equator, ok.
> But null at the interior equator, it might depend on major& minor radius.
>
>
At the interior equator, and anywhere on the disk it define, the gravity
is null. The mass under you is closer, but the mass over you is larger.
But, you will not notice that as the planet is spining on itself: the
centrifugal force will keep you on the ground. It will also somewat
offset the gravity bias.
Alain
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Kevin Wampler
Subject: Re: Numerical approximation of the gravity of a torus
Date: 10 Mar 2011 14:56:54
Message: <4d792d06$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 3/10/2011 10:59 AM, Alain wrote:
> At the interior equator, and anywhere on the disk it define, the gravity
> is null. The mass under you is closer, but the mass over you is larger.
And just how did you determine that these two factors exactly cancel out
at the interior equator?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 11 Mar 2011 12:04:30
Message: <4d7a561d@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Alain <aze### [at] qwerty org> wrote:
> At the interior equator, and anywhere on the disk it define, the gravity
> is null. The mass under you is closer, but the mass over you is larger.
Can you actually prove that?
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |