Module: Ballistics::Zero

Defined in:
lib/ballistics/zero.rb,
ext/ballistics/ballistics.c

Class Method Summary collapse

Class Method Details

._calculate_zero_angleObject



3
# File 'ext/ballistics/ballistics.c', line 3

VALUE method_calculate_zero_angle(VALUE self, VALUE drag_function, VALUE drag_coefficient, VALUE velocity, VALUE sight_height, VALUE zero_range, VALUE y_intercept);

.calculate_zero_angle(opts = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ballistics/zero.rb', line 5

def self.calculate_zero_angle(opts = {})
  options = { y_intercept: 0 }.merge(opts)

  drag_function = Ballistics::DFMap.__convert_df_to_int(options[:drag_function])
  drag_coefficient = options[:drag_coefficient]
  vi = options[:velocity]
  sight_height = options[:sight_height]
  zero_range = options[:zero_range]
  y_intercept = options[:y_intercept]

  self._calculate_zero_angle(drag_function, drag_coefficient, vi, sight_height, zero_range, y_intercept)
end