Method: Math#sin_squared

Defined in:
lib/openc3/core_ext/math.rb

#sin_squared(angle) ⇒ Float

Power reduction formula. Calculates sin squared which is (1 - cos(2 * angle)) / 2

Parameters:

  • angle (Float)

    Angle in degrees

Returns:

  • (Float)

    sin(angle) squared



36
37
38
# File 'lib/openc3/core_ext/math.rb', line 36

def sin_squared(angle)
  return (1.0 - Math.cos(2.0 * angle)) / 2.0
end