photon {lorentz}R Documentation

Photons

Description

Various functionality to deal with the 4-momentum of a photon

Usage

is.consistent.nullvec(N,TOL=1e-10)
as.photon(x,E=1)

Arguments

N

Four-momentum to be tested for nullness

TOL

tolerance

x

Vector of three-velocities

E

Energy, a scalar

Details

Returns the four-momentum of a photon.

Author(s)

Robin K. S. Hankin

See Also

4mom,reflect

Examples


## A bunch of photons all approximately parallel to the x-axis:
as.photon(as.3vel(cbind(0.9,runif(10)/1000,runif(10)/1000)))


## mirror ball:
jj <- matrix(rnorm(30),10,3)
disco <- sweep(matrix(rnorm(30),10,3),1,sqrt(rowSums(jj^2)),`/`)
p <- as.photon(c(1,0,0))
reflect(p,disco)

table(reflect(p,disco)[,2]>0) # should be TRUE with probability sqrt(0.5)

## relativistic  disco; mirror ball moves at 0.5c:

B <- boost(as.3vel(c(0.5,0,0)))
p |> tcrossprod(B) |> reflect(disco) |> tcrossprod(solve(B))



[Package lorentz version 1.1-1 Index]