Method: When::Ephemeris::ChineseTrueLunation#time_to_cn

Defined in:
lib/when_exe/region/chinese.rb

#time_to_cn(t) ⇒ Numeric

日時 -> 周期番号(唐代の定朔の暦法用 cn_to_time(1L) を使用する)

Parameters:

Returns:



717
718
719
720
721
722
# File 'lib/when_exe/region/chinese.rb', line 717

def time_to_cn(t)
  return super unless @cycle_number_1m
  time = @is_dynamical ? +t : t.to_f
  cn0  = time * @cycle_number_1m + @cycle_number_0m
  root(cn0, time, 0, 5) {|cn| cn_to_time(cn)}
end