getKongJieIndex function

Map<String, int> getKongJieIndex(
  1. int timeIndex
)

获取地空地劫的索引(按时支)

  • 亥上子时顺安劫
  • 逆回便是地空亡

解释:

  • 从亥顺数到时辰地支索引是地劫的索引
  • 从亥逆数到时辰地支索引是地空的索引

由于时辰地支的索引即是时辰的序号,所以可以直接使用时辰的序号

@param timeIndex 时辰索引【0~12】 @returns 地空、地劫索引

Implementation

Map<String, int> getKongJieIndex(int timeIndex) {
  final fixedTimeIndex = fixIndex(timeIndex);
  final haiIndex = fixEarthlyBranchIndex(EarthlyBranchName.haiEarthly);
  final kongIndex = fixIndex(haiIndex - fixedTimeIndex);
  final jieIndex = fixIndex(haiIndex + fixedTimeIndex);
  return {"kongIndex": kongIndex, "jieIndex": jieIndex};
}