ToC

Special-relativity frames

A frame is defined by a Poincare transformation from a given background 4-space frame (the "ancestor-frame"). The transformation is specified by a boost magnitude and a unit-vector boost direction, relative to the ancestor frame, and the position of the origin of the frame being defined in the ancestor frame.

The events are absolute, in that it is always possible to compare them to determine if two are the same. They will be represented with coordinates relative to some arbitrary absolute frame, "the-ether".

To keep us from going nuts, an SR frame has a name, which it uses to label coordinates in its frame.

(defn make-SR-coordinates [frame four-tuple]
{:pre [(s/up? four-tuple)
(= (count four-tuple) 4)]}
(-> four-tuple
(vary-meta assoc ::SR-coordinates? true)
(cf/claim frame)))
#object[emmy.sr.frames$make_SR_coordinates 0x13fb5ee8 "
emmy.sr.frames$make_SR_coordinates@13fb5ee8"
]
(defn SR-coordinates? [coords]
(::SR-coordinates? (meta coords) false))
#object[emmy.sr.frames$SR_coordinates_QMARK_ 0xdb32922 "
emmy.sr.frames$SR_coordinates_QMARK_@db32922"
]
(defn SR-name [coords]
(cf/frame-name
(cf/frame-owner coords)))
#object[emmy.sr.frames$SR_name 0x38348810 "
emmy.sr.frames$SR_name@38348810"
]

SR frames

(defn- coordinates->event
[ancestor-frame _ {:keys [boost-direction vc origin]}]
{:pre [(= (cf/frame-owner origin) ancestor-frame)]}
(fn c->e [coords]
{:pre [(SR-coordinates? coords)]}
((m/point ancestor-frame)
(make-SR-coordinates ancestor-frame
(+ ((b/general-boost2 boost-direction vc)
coords)
origin)))))
#object[emmy.sr.frames$coordinates__GT_event 0x7285ce0e "
emmy.sr.frames$coordinates__GT_event@7285ce0e"
]
(defn- event->coordinates
[ancestor-frame this-frame
{:keys [boost-direction vc origin]}]
{:pre [(= (cf/frame-owner origin) ancestor-frame)]}
(fn e->c [event]
{:pre [(cf/event? event)]}
(let [coords ((b/general-boost2 (- boost-direction) vc)
(- ((m/chart ancestor-frame) event)
origin))]
(make-SR-coordinates this-frame coords))))
#object[emmy.sr.frames$event__GT_coordinates 0x3bc0d2a8 "
emmy.sr.frames$event__GT_coordinates@3bc0d2a8"
]
(let [make (cf/frame-maker coordinates->event event->coordinates)]
(defn make-SR-frame [name ancestor-frame boost-direction v-over-c origin]
(make name ancestor-frame
{:boost-direction boost-direction
:vc v-over-c
:origin origin})))
#'emmy.sr.frames/make-SR-frame

The background frame

(defn base-frame-point [_ this-frame _]
(fn [coords]
{:pre [(SR-coordinates? coords)
(= this-frame (cf/frame-owner coords))]}
(cf/make-event coords)))
#object[emmy.sr.frames$base_frame_point 0x2f2e16cb "
emmy.sr.frames$base_frame_point@2f2e16cb"
]
(defn base-frame-chart [_ this-frame _]
(fn [event]
{:pre [(cf/event? event)]}
(make-SR-coordinates this-frame event)))
#object[emmy.sr.frames$base_frame_chart 0x33466f36 "
emmy.sr.frames$base_frame_chart@33466f36"
]
(def base-frame-maker
(cf/frame-maker base-frame-point base-frame-chart))
#object[emmy.calculus.frame$frame_maker$call__46804 0x6fef22ee "
emmy.calculus.frame$frame_maker$call__46804@6fef22ee"
]
(def the-ether
(base-frame-maker 'the-ether 'the-ether))
#object[emmy.calculus.frame$frame_maker$call$reify__46805 0x5287e829 "
emmy.calculus.frame$frame_maker$call$reify__46805@5287e829"
]
(defn boost-direction [frame]
(:boost-direction (cf/params frame)))
#object[emmy.sr.frames$boost_direction 0xd4034fc "
emmy.sr.frames$boost_direction@d4034fc"
]
(defn v:c [frame]
(:vc (cf/params frame)))
#object[emmy.sr.frames$v_COLON_c 0xd7fd5bd "
emmy.sr.frames$v_COLON_c@d7fd5bd"
]
(defn coordinate-origin [frame]
(:origin (cf/params frame)))
#object[emmy.sr.frames$coordinate_origin 0x1b917eae "
emmy.sr.frames$coordinate_origin@1b917eae"
]
(defn add-v:cs [v1:c v2:c]
(/ (+ v1:c v2:c)
(+ 1 (* v1:c v2:c))))
#object[emmy.sr.frames$add_v_COLON_cs 0x763a1b55 "
emmy.sr.frames$add_v_COLON_cs@763a1b55"
]
(defn add-velocities
"velocities must be in meters/second, since we don't yet have units support."
[v1 v2]
(/ (+ v1 v2)
(+ 1 (* (/ v1 'C)
(/ v2 'C)))))
#object[emmy.sr.frames$add_velocities 0x7ad126ba "
emmy.sr.frames$add_velocities@7ad126ba"
]