def sub_com_ds

bend-prot@0.1.0.0 · sim.bend:90

import bend-prot@0.1.0.0/sim.bend as Sim
import Base
import bend-prot@0.1.0.0/geom.bend as G

90def sub_com_ds(ds: List<&2, DynAtom>, +com: G.Vec3) -> List<&2, DynAtom>:
91  match ds:
92    case Nil{}:
93      Nil{}
94    case h <> t:
95      match h:
96        case DA{serial, elem, pos, vel, frc, mass}:
97          DA{serial, elem, pos, G.Vec3.sub(vel, com), frc, mass} <> sub_com_ds(t, com)

Uses (4)

Used by (1)