ClassicalParticle2D
jsci.physics

Class ClassicalParticle2D

    • Constructor Detail

      • ClassicalParticle2D

        public ClassicalParticle2D()
        Constructs a classical particle.
    • Method Detail

      • setMass

        public void setMass(double m)
        Sets the mass of this particle.
      • setPosition

        public void setPosition(double xPos,               double yPos)
        Sets the position of this particle.
      • setXPosition

        public void setXPosition(double xPos)
      • getXPosition

        public double getXPosition()
      • setYPosition

        public void setYPosition(double yPos)
      • getYPosition

        public double getYPosition()
      • setVelocity

        public void setVelocity(double xVel,               double yVel)
        Sets the velocity of this particle.
      • getXVelocity

        public double getXVelocity()
      • getYVelocity

        public double getYVelocity()
      • setMomentum

        public void setMomentum(double xMom,               double yMom)
        Sets the momentum of this particle.
      • getXMomentum

        public double getXMomentum()
      • getYMomentum

        public double getYMomentum()
      • move

        public ClassicalParticle2D move(double dt)
        Evolves this particle forward according to its kinematics. This method changes the particle's position.
        Returns:
        this.
      • translate

        public ClassicalParticle2D translate(double dt)
        Evolves this particle forward according to its linear kinematics. This method changes the particle's position.
        Returns:
        this.
      • accelerate

        public ClassicalParticle2D accelerate(double ax,                             double ay,                             double dt)
        Accelerates this particle. This method changes the particle's velocity. It is additive, that is accelerate(a1, dt).accelerate(a2, dt) is equivalent to accelerate(a1+a2, dt).
        Returns:
        this.
      • applyForce

        public ClassicalParticle2D applyForce(double Fx,                             double Fy,                             double dt)
        Applies a force to this particle. This method changes the particle's velocity. It is additive, that is applyForce(F1, dt).applyForce(F2, dt) is equivalent to applyForce(F1+F2, dt).
        Returns:
        this.
      • gravitate

        public ClassicalParticle2D gravitate(ClassicalParticle2D p,                            double dt)
        Evolves two particles under their mutual gravitational attraction. This method changes the velocity of both particles.
        Returns:
        this.
      • collide

        public ClassicalParticle2D collide(ClassicalParticle2D p,                          double theta)
        Collides this particle with another (elastic collision). This method calculates the resultant velocities.
        Parameters:
        theta - centre of mass deflection angle.
        Returns:
        this.

SCaVis 2.0 © jWork.ORG