# Physics kit

> The physics kit is the physics feature of fframes-kit (fframes-kit = { .., features = ["physics"] }).

Page: https://fframes-kit.pages.dev/docs/physics/
Cargo feature: `physics` (`fframes-kit = { version = "..", features = ["physics"] }`)

The physics kit is the `physics` feature of `fframes-kit`
(`fframes-kit = { .., features = ["physics"] }`). Its figures come with the prelude and need
no other crates. Every entry names its scene in the components gallery
(`cargo run --release -p components-gallery -- strip <Scene> -n 8`).

- **Placement.** A figure stands alone and is placed in units of `ui.space` (Manim's frame:
  8 units tall, `y` up, the origin in the middle). `scale` says how many units one meter
  is, so a 10 m throw fits on the canvas with `scale: 0.8`.
- **Units.** Quantities are SI: meters, seconds, kilograms, radians. `GRAVITY` is 9.81 m/s².
- **Time.** Each figure runs on its own clock: the local time minus `delay`, times
  `time_scale`. Before `delay` it shows its start.
- **Simulations.** A motion with a closed form (`Projectile`, `Wave`, `Orbit`, `Collision1D`) is
  computed per frame. One without (`Pendulum`, `SpringMass`) is stepped once, at 240 steps per second with RK4, into
  a motion value built in the video's constructor (a `OnceLock` field, or a field set in
  `new`). The figure borrows it through `motion: Some(&..)` and draws nothing without it.
  Field lines are traced once the same way, into a `Field`.
- **Animation props.** The fixed parts (ground, ceiling, wall) draw with `enter`; the moving
  parts fade with `parts_enter`.

- [Projectile](https://fframes-kit.pages.dev/docs/physics/projectile.md): A ball thrown at speed and angle without drag.
- [Pendulum and EnergyBars](https://fframes-kit.pages.dev/docs/physics/pendulum-and-energy-bars.md): PendulumMotion::new(length, angle0, seconds) swings a pendulum from rest without friction; PendulumMotion::damped(length, angle0, damping, seconds) slows…
- [RigidWorld](https://fframes-kit.pages.dev/docs/physics/rigid-world.md): Manim-physics' Space and SpaceScene.
- [MultiPendulum](https://fframes-kit.pages.dev/docs/physics/multi-pendulum.md): MultiPendulumMotion::new(lengths, masses, angles, seconds) solves a chain of point masses on massless rods released at rest, a double pendulum with two…
- [SpringMass](https://fframes-kit.pages.dev/docs/physics/spring-mass.md): SpringMotion::new(stiffness, mass, x0, seconds) lets a block go from rest x0 meters from its rest position, and SpringMotion::damped(stiffness, mass…
- [Wave](https://fframes-kit.pages.dev/docs/physics/wave.md): One figure for four kinds of wave, chosen by kind:
- [RadialWave](https://fframes-kit.pages.dev/docs/physics/radial-wave.md): Circular waves from every point of sources, amplitude sin(k r - ω t) each, summed where they meet.
- [FreeBody](https://fframes-kit.pages.dev/docs/physics/free-body.md): A block with forces (Force::new(name, x, y), in newtons, y up) drawn from its middle, scale units per newton.
- [Orbit](https://fframes-kit.pages.dev/docs/physics/orbit.md): A planet on a Kepler orbit around a star at focus: semi_major units, eccentricity, the perihelion to the right of the star, once around every period…
- [FieldLines](https://fframes-kit.pages.dev/docs/physics/field-lines.md): Field::new(charges, lines_per_charge, bounds) traces the field lines of point charges once (Charge::new(x, y, q)).
- [ElectricField and MagneticField](https://fframes-kit.pages.dev/docs/physics/electric-field-and-magnetic-field.md): ElectricField is manim-physics' ElectricField: an arrow on every grid point of x_range by y_range, pointing along the field of charges and coloured by…
- [Circuit](https://fframes-kit.pages.dev/docs/physics/circuit.md): A series circuit on a rectangular loop: a battery on the left side, a switch on the top, a bulb on the right and a resistor on the bottom.
- [Symbol and Schematic](https://fframes-kit.pages.dev/docs/physics/symbol-and-schematic.md): Symbol draws one circuit part: SymbolKind::Resistor, Capacitor, Inductor, VoltageSource, CurrentSource, Ground, Opamp (Manim-circuit's set), and Battery…
- [RayDiagram and Refraction](https://fframes-kit.pages.dev/docs/physics/ray-diagram-and-refraction.md): RayDiagram draws the three principal rays of a thin lens (Optic::Lens) or a mirror (Optic::Mirror).
- [OpticalBench, Lens and Ray](https://fframes-kit.pages.dev/docs/physics/optical-bench-lens-and-ray.md): OpticalBench is manim-physics' Lens and Ray: lenses on one horizontal axis, and rays traced through them from left to right.
- [Collision1D](https://fframes-kit.pages.dev/docs/physics/collision-1d.md): Carts A and B on a track that collide head on: masses m1, m2, velocities u1, u2, centers x1, x2, and a restitution from 1 (elastic) to 0 (they stick…
- [Doppler](https://fframes-kit.pages.dev/docs/physics/doppler.md): A source moving right from start at source_speed m/s sends out a front every period seconds, and the fronts spread at wave_speed m/s.
- [GasBox](https://fframes-kit.pages.dev/docs/physics/gas-box.md): GasMotion::new(GasSetup { .. }) steps count hard balls in a box once, at 240 steps a second: elastic collisions between equal masses and with the walls…
