# Re: C-ship

```Timothy van der Linden writes:
> >I am still trying to get enough understanding of special
> >relativity theory to make sure I get things right.  I also want
> >to work out more of the mathematical techniques I will use.
>
> Once that is ready, writing the simulator is easy ;)

Yes, and that's why I've spent all my time on that so far, with a
relatively brief digression into astrophysics to develop a simple
but adequate model of starlight and a 3-d star database from
catalogs.

> >The basic structure of the simulation will be to model worldlines
> >for all objects, and compute visibility for display by tracing
> >light-like worldlines from a observer point to the other
> >worldlines in the simulation in some common frame, then transform
> >apparent positions of these objects in the common frame into the
> >frame of the observer.
>
> Indeed, but for this you need to have a history of all the objects positions.
> As long as they move linear or linear accelerated that's not so difficult
> because you can use a function. But as soon as the behaviour gets less
> simple you may need large arrays and with it come less precise calculations.
> Also it would be nice to see the time at every point of the several objects
> (for example by halting the simulation and clicking with the mouse).

I realize that a motion history is necessary.  In fact, the
fundamental information associated with a typical object will be
a worldline, consisting of straight and accelerated segments.
The worldline represents the full motion history of an object, so
in theory you could go to any point in spacetime in any frame and
get a view of the universe by tracing intersections to the
worldlines of all the other objects, then transforming those
displacements into the view frame.

I recognize the problem of dealing with more complicated types of
motion.  I at least want to work out a reasonable method of
handling orbital motion so you can see what it looks like to
boost into or out of a solar system.

> >I think most of the relativistic effects, particularly things
> >like aberration and rotation induced by moving at relativistic
> >speed, can come out of fundamental behavior of the simulation
> >rather than having to be explicitly calculated in each case.
> >Aberration is simply a result of the way worldlines of light rays
> >Lorentz-transform.
>
> Rotation will indeed follow from the finite speed of light. But I don't see
> how abberation does not show up after the LT of the worldlines. Lightrays
> coming form the backside of the observer won't come from the front after the LT.

Check out the exercises in Chapter L (that's what they call it)
of _Spacetime Physics_.  Aberration and the "headlight effect"
both follow directly from the geometry of the Lorentz
transformation applied to light rays.

Remember that a displacement along a worldline of a light ray is
different than a plain spacial displacement, so applying a
Lorentz transform to it produces a different result.  Try out the
numbers and I think you'll be surprised.  I just ran an example
for myself with a Lorentz transform matrix for a boost of 0.9 c
in the x direction, and light rays coming from a perpendicular
direction (say from along the y or z axes).  They really do end
up looking like they're in front of you when transformed into the
"moving" frame.

> >Rather than seeing Lorentz contraction, you
> >see object rotation, because you see light from farther parts of
> >an object that came from it earlier than light from nearer
> >parts.  I am trying to prove to myself that all these effects
> >will fall out of the simulation model I want to use; so far I am
> >pretty confident that I'm on the right track.
>
> This rotation is only seen if the object moves along you, thus not towards you.

Correct.  If your optics all take into account the finite speed
of light, though, you will not necessarily see the amount of
Lorentz contraction you'd think.  Farther portions of the object
are seen farther back in time when they were farther away.

> >>What I asked John Walker was that I would expect curved lines in the SHUTTLE
> >>and FLYTHRU movies. I think this curvature would be result of the finite
> >>travel speed of light, ie. light from further objects reach the observer
> >>later than the light from nearer object.
> >
> >That effect should happen.
>
> I've been rethinking this bending of the lines today. And now I think that
> the lines should be straight. The lines are only curved if the objects are
> moving. If the observer is moving and the objects don't move this bending
> will not occur. What do you think after reading this?
>
> This would mean that you could "easely" recognize moving objects because of
> the curvature they have and that still objects don't have.

Which is why you should be suspicious.  In the case of a
constant-velocity observer, it is not possible to decide whether
the observer or its surroundings are moving.  (An accelerated
observer experiences something that the rest of the universe does
not; an accelerated observer knows that he is accelerating.)

The appearance of curvature for large fast-moving objects will
happen.  Your arbitrary decision of whether the object is still
or moving does not affect the geometry of the light; you can
simply apply a Lorentz transform to the situation where the ship
is moving and the object is still and get the situation where the
ship is still and the object is moving, with the same view from
the ship.

The appearance of curvature is an effect of the finite speed of
light.  A snapshot of a scene captures light that arrived at the
camera all at the same time.  So light from farther portions of
an object must have been emitted earlier, when the farther
portions were farther back in their motion history, in order to
be seen at the same time as light from nearer portions.  This
effect only becomes pronounced if the object subtends a large
part of the field of view and is moving at a large fraction of
c.

> Yes, you need to know the functions of motion several points of an object.
> Let's call one point of the object P[t].
> Call the point of the observer O[t].
> What does the observer see at time T1? The observer sees an object if a
> photon that left the object at time T0 reached the position O[T1].
>
> So in formula's:
>
> c*(T1-T0)=Sqrt((O[T1]-P[T0])^2)    c is the speed of light
>
> With this equation one can calculate T0. When knowing that, you can
> determine the position of the object at T0, so then you know from what
> direction and from how far the photon came.
>
> Do this for all object-points and you have a created the "see-able" world,
> after that you could use the c-ship program.

That's the basic approach, although I use 4-vectors to represent
time and position in the same object.

First, for a U = [ u0 u1 u2 u3 ] and V = [ v0 v1 v2 v3 ], U|V =
u0*v0 - u1*v1 - u2*v2 - u3*v3 (Lorentz inner product), and U^2 =
U|U.  U^2 is the square of the spacetime interval of a
displacement represented by U.  Velocities are neatly represented
by vectors V where V^2 = 1; the components of the vector can be
interpreted as displacements in frame coordinates per unit object
time.  Convert a frame velocity V = [ 1 v1 v2 v3 ] into a unit
vector by dividing all components by sqrt(V^2).

If you are at a point S = [ t x y z ], and you want to view an
object whose worldline is described by P(t') = P0 + V * t' =
[ t0 x0 y0 z0 ] + [ v0 v1 v2 v3 ] * t', then the path of a light ray
between S and P satisfies the equation (S - P(t'))^2 = 0, The
solution is:

t' = ((S - P0)|V - sqrt(((S - P0)|V)^2 - (S - P0)^2 * V^2)) / V^2

This is pretty much simple application of the quadratic formula,
choosing the smallest solution to get the t' that corresponds to
light leaving the object at an earlier time than the observer's.

Things are substantially more complicated when dealing with
accelerated worldlines.  I've got a preliminary solution stated
in similar terms as the above discussion; perhaps you'd like to
check my math :-).

You are at the point S = [ t x y z ] attempting to view an object
whose coordinates are P(t') =

1/a^2 * [ a * sinh(a * t')
ax * (cosh(a * t') - 1)
ay * (cosh(a * t') - 1)
az * (cosh(a * t') - 1) ]

where the acceleration is represented by A = [ 0 ax ay az ] (in
the object local frame) and a = sqrt(ax^2 + ay^2 + az^2) (the
magnitude of the acceleration).

So again, we want to solve the equation (S - P(t'))^2 = 0.  Of
course, the components of P(t') are much more complicated.  I
won't bore you with the full derivation, other than to note that
it becomes easier to isolate t' by writing the sinh and cosh
terms in terms of their definitions using exp (e^x).

Eventually, you get:

exp(a * t')^2 * (1 - A|S - a * t') +
exp(a * t') *   (a^2 * S^2 - 2 * (1 - A|S)) +
(1 - A|S + a * t')
= 0

It's convenient to make some substitutions for common
subexpressions:

k = 1 - A|S
p = k - a * t'
q = a^2 * S^2 - 2 * k
r = k + a * t'

So then applying the quadratic formula and isolating t' gives:

t' = 1/a * ln((-q - sqrt(q^2 - 4 * p * r)) / (2 * p))

I have yet to program this expression into my calculator and play
with some solutions to see if they have the predicted results.
In particular, there should be regions of spacetime where you
cannot see the accelerated object (see Chapter 6 of
_Gravitation_).

You will also note that this is a somewhat less general statement
of the problem; it uses a frame in which the accelerated object
was at rest at the origin of the frame.  For a general solution
you would need to transform the view point into the appropriate
frame, apply this solution, and transform it back out afterwards.

> >Now that I think about it, simple extensions to POVray for
> >modeling relativistic effects probably wouldn't work well,
> >because you really have to raytrace in four dimensions to
> >properly model them.
>
> Indeed, although it is easy to calculate the length of the lightray, it is
> much more difficult to know where all object where in the past.

For the purposes of the guy's C-ship simulation he would have to
model acceleration, at least, which would substantially
complicate things.

My plan for my simulation will be to develop some heuristics to
find the right worldline segment to which to apply the analytic
solutions above, and possibly some other heuristics to discard
old pieces of worldlines that are no longer visible to other
important simulation objects.

```

• Follow-Ups:
• Re: C-ship
• From: Steve VanDevender <stevev@efn.org>
• References:
• Re: C-ship
• From: T.L.G.vanderLinden@student.utwente.nl (Timothy van der Linden)