<commit_before>-- degrees
local d120 = tau/3
local d60 = d120 / 2
local d30 = d60 / 2

-- tetrahedron dimensions
local r = 1 -- face to vertex
local s = 2*r*sin(d60) -- side length
local h = sqrt(s*s-r*r) -- face to vertex opposite face
local theta = acos(r/s) -- face to vertex to vertex opposite face
local c = s/2/sin(theta) -- center to vertex
local d = s/2/tan(theta) -- center to edge
local e = r*cos(d60) -- face to edge
local f = h-c -- center to face

-- having to add 0.1 to compensate error roundoff
local fovr = 2*atan(s/2/f)+0.1
local fovd = fovr * 180 / pi

local y = e - e*e/(r+e)
local z =-f + h*e/(r+e)

plates = {
   { -- top
      {0,-y/f,z/f},
      {0,-(e-y)/e,(-f-z)/e}, 
      fovd
   },
   { -- left
      {y/f*sin(d120),-y/f*cos(d120),z/f},
      {(e-y)/e*sin(d120),-(e-y)/e*cos(d120),(-f-z)/e}, 
      fovd
   },
   { -- right
      {y/f*sin(-d120),-y/f*cos(-d120),z/f},
      {(e-y)/e*sin(-d120),-(e-y)/e*cos(-d120),(-f-z)/e}, 
      fovd
   },
   {{0,0,-1},{0,-1,0},fovd} -- back
}<commit_msg>fixed tetra globe FOV math (face to vertex is longer than half side length)<commit_after>-- degrees
local d120 = tau/3
local d60 = d120 / 2
local d30 = d60 / 2

-- tetrahedron dimensions
local r = 1 -- face to vertex
local s = 2*r*sin(d60) -- side length
local h = sqrt(s*s-r*r) -- face to vertex opposite face
local theta = acos(r/s) -- face to vertex to vertex opposite face
local c = s/2/sin(theta) -- center to vertex
local d = s/2/tan(theta) -- center to edge
local e = r*cos(d60) -- face to edge
local f = h-c -- center to face

-- compute fov
local fovr = 2*atan(r/f)
local fovd = fovr * 180 / pi + 1 -- +1 to get rid of the hole in the center
print(fovd)

local y = e - e*e/(r+e)
local z =-f + h*e/(r+e)

plates = {
   { -- bottom
      {0,-y/f,z/f},
      {0,-(e-y)/e,(-f-z)/e}, 
      fovd
   },
   { -- right
      {y/f*sin(d120),-y/f*cos(d120),z/f},
      {(e-y)/e*sin(d120),-(e-y)/e*cos(d120),(-f-z)/e}, 
      fovd
   },
   { -- left
      {y/f*sin(-d120),-y/f*cos(-d120),z/f},
      {(e-y)/e*sin(-d120),-(e-y)/e*cos(-d120),(-f-z)/e}, 
      fovd
   },
   {{0,0,-1},{0,-1,0},fovd} -- back
}

{'fraction_non_alphanumeric': 0.21919096895578552, 'fraction_numerical': 0.05879586077140169, 'mean_word_length': 2.2227272727272727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3988315', 'n_tokens_mistral': 1035, 'n_tokens_neox': 937, 'n_words': 233}