Package jsim.forces

Class MagnusForce

java.lang.Object
jsim.forces.MagnusForce
All Implemented Interfaces:
ForceGenerator

public final class MagnusForce extends Object implements ForceGenerator
Magnus force for spinning projectiles: F_magnus = k · (ω × v).

The cross product of angular velocity with linear velocity produces a lift force perpendicular to the spin axis, causing curved flight. The Magnus coefficient k (kg/rad·m) is empirically determined per object (typically 0.1–2.0 for FRC game pieces).

  • Constructor Details

    • MagnusForce

      public MagnusForce(RigidBody body, double magnusCoefficient)
      Create a Magnus force generator for the given body.
      Parameters:
      body - the spinning body to apply Magnus lift to
      magnusCoefficient - Magnus lift coefficient k (kg)
  • Method Details

    • apply

      public void apply(double dt)
      Description copied from interface: ForceGenerator
      Apply forces/torques to whichever bodies this generator influences.
      Specified by:
      apply in interface ForceGenerator
      Parameters:
      dt - the fixed simulation timestep in seconds