local function _0_(pos)
  return string.format("%d#%d#%d", pos.x, pos.y, pos.z)
end
hash_node_pos = _0_
local function _1_(A, B)
  local function _2_()
    if ((B.x < A.x) or (B.y < A.y) or (B.z < A.z)) then
      return {B, A}
    else
      return {A, B}
    end
  end
  local _3_ = _2_()
  local pos1 = _3_[1]
  local pos2 = _3_[2]
  return string.format("%s&%s", hash_node_pos(pos1), hash_node_pos(pos2))
end
hash_node_connect = _1_
local function _2_(pos)
  local dir = minetest.facedir_to_dir(minetest.get_node(pos).param2)
  local cross = vector.cross(dir, k)
  local input = hash_node_connect(pos, vector.subtract(pos, dir))
  local output = hash_node_connect(pos, vector.add(pos, dir))
  local control = hash_node_connect(pos, vector.add(pos, cross))
  return input, output, control
end
dirtwopole = _2_
local function _3_(device, name, pos, value)
  local input, output = dirtwopole(pos)
  return {current = ("v" .. name), neg = output, pos = input}, {{["neg-node"] = ("hole-" .. name), ["pos-node"] = input, name = name, type = device, value = value}, {["neg-node"] = output, ["pos-node"] = ("hole-" .. name), name = ("v" .. name), type = "voltage", value = complex(0, 0)}}
end
twopole = _3_
local function _4_(pos, id)
  local meta = minetest.get_meta(pos)
  local R = real((meta:get_float("resis") or 0))
  local X_e2_80_b2 = (meta:get_float("react") or 0)
  local X = nil
  if (X_e2_80_b2 >= 0) then
    X = inductance(X_e2_80_b2)
  else
    X = capacitance(X_e2_80_b2)
  end
  return twopole("consumer", id, pos, (R + X))
end
consumer = _4_
local function _5_(pos, id)
  local meta = minetest.get_meta(pos)
  local emf = meta:get_float("emf")
  local resis = meta:get_float("resis")
  local dir = minetest.facedir_to_dir(minetest.get_node(pos).param2)
  local input = hash_node_connect(pos, vector.subtract(pos, dir))
  local output = hash_node_connect(pos, vector.add(pos, dir))
  return {current = id, neg = output, pos = input}, {{["neg-node"] = ("hole-" .. id), ["pos-node"] = input, name = id, type = "voltage", value = real(emf)}, {["neg-node"] = output, ["pos-node"] = ("hole-" .. id), name = ("r" .. id), type = "consumer", value = real(resis)}}
end
vsource = _5_
local function _6_(pos)
  local in_pin = vector.new(1, 0, 0)
  local out_pin = vector.new(0, 0, 1)
  local prim_e2_82_81 = vector.add(pos, in_pin)
  local prim_e2_82_82 = vector.add(pos, out_pin)
  local sec_e2_82_81 = vector.subtract(pos, in_pin)
  local sec_e2_82_82 = vector.subtract(pos, out_pin)
  return {["prim\226\130\129"] = hash_node_connect(pos, prim_e2_82_81), ["prim\226\130\130"] = hash_node_connect(pos, prim_e2_82_82), ["sec\226\130\129"] = hash_node_connect(pos, sec_e2_82_81), ["sec\226\130\130"] = hash_node_connect(pos, sec_e2_82_82)}
end
twoport = _6_
return nil
