Method: Joules.magnetic_force_v2

Defined in:
lib/joules/magnetic_fields.rb

.magnetic_force_v2(flux_density, charge, velocity, angle = 90) ⇒ Float

Note:

There is one other method for calculating magnetic force.

Calculates the magnetic force on a moving charge given flux density, charge, velocity, and angle.

Examples:

Joules.magnetic_force_v2(0.06, 34, 60) #=> 122.4

Parameters:

  • flux_density (Int, Float)

    flux_density is in teslas

  • charge (Int, Float)

    charge is in coulombs

  • velocity (Int, Float)

    velocity is in metres per second

  • angle (Int, Float) (defaults to: 90)

    angle is in degrees

Returns:

  • (Float)

    return value is in newtons



48
49
50
# File 'lib/joules/magnetic_fields.rb', line 48

def magnetic_force_v2(flux_density, charge, velocity, angle = 90)
  return flux_density * charge * velocity * Math.sin(to_radians(angle))
end