comp.lang.ada
 help / color / mirror / Atom feed
* RE: vectors, spacetime
  1999-11-19  0:00 vectors, spacetime G M Wallace
@ 1999-11-19  0:00 ` Wilhelm Spickermann
  1999-11-19  0:00   ` tmoran
  0 siblings, 1 reply; 3+ messages in thread
From: Wilhelm Spickermann @ 1999-11-19  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2224 bytes --]


On 19-Nov-99 G M Wallace wrote:

..
> little arrows pointing with wind flow direction) - would it be right
> to
> define a vector as a record with several properties (speed,
> direction,
> accelleration, etc.) and then construct a multidimensional array of
> such
> records ?  Or is a vector only applicable to single qualities - like
> speed, direction, etc. There is probably some much simpler solution.
..

Mathematical vectors are a very general thing, they are just pairs,
triples, tuples of something. In physics they are used that way,
but in many cases vectors are homogeneous in physics. It�s very handy,
to have a vector of speed components -- then mathematics can be used to
get a vector of acceleration components from that. So it depends on what
problem you are dealing with. In Ada, this is implemented as an array
or as a record.

..
>   If someone was to attempt to computationally represent a spacetime
> system in terms of three dimensions of space and one dimension of
> time,
> because time is a 'negative' quality in relativistic equations, does
> that create insurmountable probelsm of definition and reference ? 
..

No, it doesn�t. What You need here is a programming language which
allows You to hide the implementation and to define operators. Ada
is a very good choice for that problem.

..
> The
> square root of -1 is a complex number and i am aware that there ARE
> ada
> packages to deal with such things.  However - in spacetime it is
..

Well, surely we can view spacetime a subspace of a C^4 (four complex
components), but thats much too general as we dont need four of eight
components involved here. There is a mathematical model for what we
we need here, which is sometimes called R^{3,1} (as far as I remember -
thats long ago for me). It has four real components, but a different
metric etc. (the fourth component behaves a little imaginary).

Taking this as a model for programming, I would _not_ view the
components as having different types as You did in Your example. I would
only view the vectors as having different operations. That would be a
private array of four real components, with the appropriate operations
like "abs" (sqrt(x^2+y^2+z^2-t^2)) defined. 

Wilhelm






^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: vectors, spacetime
  1999-11-19  0:00 ` Wilhelm Spickermann
@ 1999-11-19  0:00   ` tmoran
  0 siblings, 0 replies; 3+ messages in thread
From: tmoran @ 1999-11-19  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

>Mathematical vectors are a very general thing, they are just pairs,
>triples, tuples of something. In physics they are used that way,
>but in many cases vectors are homogeneous in physics. It�s very handy,
  To follow the weather map example, you could have wind velocity
vectors, each with three components:  the speed E-W, N-S and
up-down.  But you might alternatively choose to have vectors with
5 components:  the three speed components and also the temperature
and humidity at that point.  Programming-wise, it just a question
of what's more convenient.  However, while it makes sense to talk
about total wind speed as sqrt(vx**2+vy**2+vz**2), the quantity
sqrt(vx**2+vy**2+vz**2+temperature**2+humidity**2) is surely a
meaningless, useless number.

> It has four real components, but a different metric etc. (the
> fourth component behaves a little imaginary).
  The "different metric" is key.  While the space-distance is
sqrt(dx**2+dy**2+dz**2), the relativistic "distance" includes not
"+t**2" but rather "-(ct)**2".  But you can use regular
componentwise addition and subtraction.  Say baby Fred was born in
a hospital.  Baby Sam was born 20 feet to the east, 1 floor (10
feet) higher up, and 3 days later.  Baby Charles was born 10 feet
to the west of Sam, on the same floor, and 2 days earlier.
Ordinary, componentwise arithmetic tells us Charles was born 10
feet to the East of Fred, 1 floor up, and 1 day later.  But to
calculate the relativistic "distance" between the births, you need
to treat that time component differently.  So if your program was
using a generic package that does ordinary arithmetic on vectors
with N components, you would have to overide its ordinary
"distance" function with the relativistic one.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* vectors, spacetime
@ 1999-11-19  0:00 G M Wallace
  1999-11-19  0:00 ` Wilhelm Spickermann
  0 siblings, 1 reply; 3+ messages in thread
From: G M Wallace @ 1999-11-19  0:00 UTC (permalink / raw)


Ok.  I will keep trying to ask for information coz I am doing the
self-education thing.
I realise this place is inhabited by professional programmers and I am
grateful for any
and all help given to me and my remedial questions.  Remember - this is
also part of a philosophical study for me.  2 questions 2day.


1)
  I have been looking through a physics textbook and thinking about
Ada.  I have certainly come across VECTORS in the source code for a
variety of things.  I am wondering this - if a vector has (or can have)
several parameters - and in defining something like the wind flow
patterns over land or sea (as in weather images with the zillions of
little arrows pointing with wind flow direction) - would it be right to
define a vector as a record with several properties (speed, direction,
accelleration, etc.) and then construct a multidimensional array of such
records ?  Or is a vector only applicable to single qualities - like
speed, direction, etc. There is probably some much simpler solution.
Yes, this may be a more general question but in asking ada programmers I
see the way you think about such things.  OK.

2)
(The answers I may or may not get on this question will undoubtedly be a
little bit beyond me but I would appreciate and and all contributions
from amateurs or professionals who frequent comp.lang.ada).
  If someone was to attempt to computationally represent a spacetime
system in terms of three dimensions of space and one dimension of time,
because time is a 'negative' quality in relativistic equations, does
that create insurmountable probelsm of definition and reference ?  The
square root of -1 is a complex number and i am aware that there ARE ada
packages to deal with such things.  However - in spacetime it is
possible to rotate the four dimensional axes relative to an initial
point of reference in much the same way one may rotate a three
dimensional frame in everyday (i.e. intuitive) space.  In the case where
one must account for two different inertial frames of reference - the
four dimensional 'wire-frame' metric may indeed be rotated.  In this
case - and quite literally with experimental verification, spatial and
temporal dimensions may rotate into one another - what is distance for
one observer may become duration for another - and all the possible
anamorphic distortions between such ideal cases. (Granted that we have
to be talkling about significant velocities or gravitational masses
before the effects become anything like dramatic).
  Are the three space and one temporal dimensions thus to be cast as all
of the same type ?  What, then, of the fact that the thre espatial
dimensions are rendered as positive numbers and the temporal as a
negative.  (I am aware of the fact that there can be problems with types
when certain measurement units are employed).

  Would one cast something like :

-------------------------------
-- spacetime.ads
------------------------------
package spacetime is

  type unit is new integer;
  type dimension is abstract tagged null record;
  type dimension_access is access dimension;

  type spatial_unit is new dimension with
  record
    coord : unit;
  end record;

  type temporal_unit is new dimension with
  record
    coord : unit;
  end record;

end spacetime;

---------------------------------

  Of course, I don't know what happens at deeper levels.  The whole
business with the compatibility of time as negative one sqaured and as
x, y, and z as positive numbers squared and then the ability to trasnfer
(or partially so) quantities and measurement form one fram to another is
something I understand conceptually more than computationally.  And even
if no one responds,
it helps me heaps to work out more to put it up here coz
I have to think it through in a presentable form.

p.s.
In terms of spacetime - there exists one inertial frame of reference
such that a projectile travelling at (an idealised) constant velocity
can be 'seen' from another inertial frame as existing simultaneously at
every point on its journey.  Makes new sense of the Zen archery (Kyudo)
concept of man, bow, arrow and target all 'being one'.  :-)
--
Graeme Wallace
Canberra
Australia

"He attracted some attention / When he discovered the fourth dimension /
But he ain't got rhythm / So no one's with him / The loneliest man in
town"

              -- 1940's song lyric.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-11-19  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-19  0:00 vectors, spacetime G M Wallace
1999-11-19  0:00 ` Wilhelm Spickermann
1999-11-19  0:00   ` tmoran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox