Class DynamicParticlePolar

All Implemented Interfaces:
PropertyChangeListener, EventListener, Drawable, Interactive, Measurable, Trackable, ODE
Direct Known Subclasses:
DynamicSystem

public class DynamicParticlePolar extends DynamicParticle
DynamicParticlePolar models a particle using Newton's 2nd law in polar coordinates.
Version:
1.0
Author:
D. Brown
  • Field Details

    • polarVars

      protected static final String[] polarVars
  • Constructor Details

    • DynamicParticlePolar

      public DynamicParticlePolar()
  • Method Details

    • getBoostVars

      protected String[] getBoostVars()
      Overrides:
      getBoostVars in class DynamicParticle
    • getInitialState

      public double[] getInitialState()
      Gets the initial state {x, vx, y, vy, t}.
      Overrides:
      getInitialState in class DynamicParticle
      Returns:
      the initial state
    • getXYForces

      protected void getXYForces(double[] cartesianState, double[] ret)
      Gets the x- and y-forces based on a specified cartesian state {x, vx, y, vy, t}.
      Overrides:
      getXYForces in class DynamicParticle
      Parameters:
      cartesianState - the state
      ret - the forces [fx, fy]
    • initializeFunctionPanel

      protected void initializeFunctionPanel()
      Creates and initializes the ModelFunctionPanel.
      Overrides:
      initializeFunctionPanel in class DynamicParticle
    • initializeInitEditor

      protected void initializeInitEditor()
      Creates the initial position and velocity parameters.
      Overrides:
      initializeInitEditor in class DynamicParticle
    • getPolarState

      protected double[] getPolarState(double[] state, double[] ret)
      Converts a cartesian state {x, vx, y, vy, t} to polar {r, vr, theta, omega, t}, both relative to the origin.
      Parameters:
      state - the cartesian state
      ret - the temp return array; may be state
      Returns:
      the polar state in ret
    • getBoostState

      protected double[] getBoostState(PointMass target, int frameNumber)
      Description copied from class: DynamicParticle
      Gets the cartesian state {x, vx, y, vy, t} of a PointMass at a specified frame number.
      Overrides:
      getBoostState in class DynamicParticle
      Parameters:
      target - the PointMass
      frameNumber - the frame number
      Returns:
      the state, or null if the point mass is not marked at the frame number
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an ObjectLoader to save and load data for this class.
      Returns:
      the object loader