@persislabs/persis-times 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +32 -4
- package/dist/core/astronomy/dynamical-time.cjs +1 -0
- package/dist/core/astronomy/dynamical-time.d.cts +27 -0
- package/dist/core/astronomy/dynamical-time.d.ts +27 -0
- package/dist/core/astronomy/dynamical-time.js +1 -0
- package/dist/core/astronomy/julian-day.cjs +1 -0
- package/dist/core/astronomy/julian-day.d.cts +46 -0
- package/dist/core/astronomy/julian-day.d.ts +46 -0
- package/dist/core/astronomy/julian-day.js +1 -0
- package/dist/core/astronomy/moon-distance.cjs +1 -0
- package/dist/core/astronomy/moon-distance.d.cts +27 -0
- package/dist/core/astronomy/moon-distance.d.ts +27 -0
- package/dist/core/astronomy/moon-distance.js +1 -0
- package/dist/core/astronomy/moon-function-meeus.cjs +1 -0
- package/dist/core/astronomy/moon-function-meeus.d.cts +62 -0
- package/dist/core/astronomy/moon-function-meeus.d.ts +62 -0
- package/dist/core/astronomy/moon-function-meeus.js +1 -0
- package/dist/core/astronomy/moon-function.cjs +1 -0
- package/dist/core/astronomy/moon-function.d.cts +53 -0
- package/dist/core/astronomy/moon-function.d.ts +53 -0
- package/dist/core/astronomy/moon-function.js +1 -0
- package/dist/core/astronomy/moon-latitude.cjs +1 -0
- package/dist/core/astronomy/moon-latitude.d.cts +22 -0
- package/dist/core/astronomy/moon-latitude.d.ts +22 -0
- package/dist/core/astronomy/moon-latitude.js +1 -0
- package/dist/core/astronomy/moon-longitude.cjs +1 -0
- package/dist/core/astronomy/moon-longitude.d.cts +29 -0
- package/dist/core/astronomy/moon-longitude.d.ts +29 -0
- package/dist/core/astronomy/moon-longitude.js +1 -0
- package/dist/core/astronomy/nutation-meeus.cjs +1 -0
- package/dist/core/astronomy/nutation-meeus.d.cts +9 -0
- package/dist/core/astronomy/nutation-meeus.d.ts +9 -0
- package/dist/core/astronomy/nutation-meeus.js +1 -0
- package/dist/core/astronomy/nutation.cjs +1 -0
- package/dist/core/astronomy/nutation.d.cts +12 -0
- package/dist/core/astronomy/nutation.d.ts +12 -0
- package/dist/core/astronomy/nutation.js +1 -0
- package/dist/core/astronomy/sun-function-meeus.cjs +1 -0
- package/dist/core/astronomy/sun-function-meeus.d.cts +55 -0
- package/dist/core/astronomy/sun-function-meeus.d.ts +55 -0
- package/dist/core/astronomy/sun-function-meeus.js +1 -0
- package/dist/core/astronomy/sun-function.cjs +1 -0
- package/dist/core/astronomy/sun-function.d.cts +74 -0
- package/dist/core/astronomy/sun-function.d.ts +74 -0
- package/dist/core/astronomy/sun-function.js +1 -0
- package/dist/core/astronomy/time-scale.cjs +1 -0
- package/dist/core/astronomy/time-scale.d.cts +7 -0
- package/dist/core/astronomy/time-scale.d.ts +7 -0
- package/dist/core/astronomy/time-scale.js +1 -0
- package/dist/core/dart.cjs +1 -0
- package/dist/core/dart.js +1 -0
- package/dist/core/math/math-utils.cjs +1 -0
- package/dist/core/math/math-utils.d.cts +55 -0
- package/dist/core/math/math-utils.d.ts +55 -0
- package/dist/core/math/math-utils.js +1 -0
- package/dist/core/math/safe-math.cjs +1 -0
- package/dist/core/math/safe-math.d.cts +11 -0
- package/dist/core/math/safe-math.d.ts +11 -0
- package/dist/core/math/safe-math.js +1 -0
- package/dist/core/prayer/prayer-method.cjs +1 -0
- package/dist/core/prayer/prayer-method.d.cts +35 -0
- package/dist/core/prayer/prayer-method.d.ts +35 -0
- package/dist/core/prayer/prayer-method.js +1 -0
- package/dist/core/prayer/waktu-salat.cjs +1 -0
- package/dist/core/prayer/waktu-salat.d.cts +37 -0
- package/dist/core/prayer/waktu-salat.d.ts +37 -0
- package/dist/core/prayer/waktu-salat.js +1 -0
- package/dist/core/qibla/arah-kiblat.cjs +1 -0
- package/dist/core/qibla/arah-kiblat.d.cts +59 -0
- package/dist/core/qibla/arah-kiblat.d.ts +59 -0
- package/dist/core/qibla/arah-kiblat.js +1 -0
- package/dist/data/moon-data-b001.cjs +1 -0
- package/dist/data/moon-data-b001.js +1 -0
- package/dist/data/moon-data-b002.cjs +1 -0
- package/dist/data/moon-data-b002.js +1 -0
- package/dist/data/moon-data-b003.cjs +1 -0
- package/dist/data/moon-data-b003.js +1 -0
- package/dist/data/moon-data-b004.cjs +1 -0
- package/dist/data/moon-data-b004.js +1 -0
- package/dist/data/moon-data-b005.cjs +1 -0
- package/dist/data/moon-data-b005.js +1 -0
- package/dist/data/moon-data-b006.cjs +1 -0
- package/dist/data/moon-data-b006.js +1 -0
- package/dist/data/moon-data-b007.cjs +1 -0
- package/dist/data/moon-data-b007.js +1 -0
- package/dist/data/moon-data-b008.cjs +1 -0
- package/dist/data/moon-data-b008.js +1 -0
- package/dist/data/moon-data-b101.cjs +1 -0
- package/dist/data/moon-data-b101.js +1 -0
- package/dist/data/moon-data-b201.cjs +1 -0
- package/dist/data/moon-data-b201.js +1 -0
- package/dist/data/moon-data-l001.cjs +1 -0
- package/dist/data/moon-data-l001.js +1 -0
- package/dist/data/moon-data-l002.cjs +1 -0
- package/dist/data/moon-data-l002.js +1 -0
- package/dist/data/moon-data-l003.cjs +1 -0
- package/dist/data/moon-data-l003.js +1 -0
- package/dist/data/moon-data-l004.cjs +1 -0
- package/dist/data/moon-data-l004.js +1 -0
- package/dist/data/moon-data-l005.cjs +1 -0
- package/dist/data/moon-data-l005.js +1 -0
- package/dist/data/moon-data-l006.cjs +1 -0
- package/dist/data/moon-data-l006.js +1 -0
- package/dist/data/moon-data-l007.cjs +1 -0
- package/dist/data/moon-data-l007.js +1 -0
- package/dist/data/moon-data-l008.cjs +1 -0
- package/dist/data/moon-data-l008.js +1 -0
- package/dist/data/moon-data-l009.cjs +1 -0
- package/dist/data/moon-data-l009.js +1 -0
- package/dist/data/moon-data-l010.cjs +1 -0
- package/dist/data/moon-data-l010.js +1 -0
- package/dist/data/moon-data-l011.cjs +1 -0
- package/dist/data/moon-data-l011.js +1 -0
- package/dist/data/moon-data-l012.cjs +1 -0
- package/dist/data/moon-data-l012.js +1 -0
- package/dist/data/moon-data-l013.cjs +1 -0
- package/dist/data/moon-data-l013.js +1 -0
- package/dist/data/moon-data-l101.cjs +1 -0
- package/dist/data/moon-data-l101.js +1 -0
- package/dist/data/moon-data-l201.cjs +1 -0
- package/dist/data/moon-data-l201.js +1 -0
- package/dist/data/moon-data-l301.cjs +1 -0
- package/dist/data/moon-data-l301.js +1 -0
- package/dist/data/moon-data-r001.cjs +1 -0
- package/dist/data/moon-data-r001.js +1 -0
- package/dist/data/moon-data-r002.cjs +1 -0
- package/dist/data/moon-data-r002.js +1 -0
- package/dist/data/moon-data-r003.cjs +1 -0
- package/dist/data/moon-data-r003.js +1 -0
- package/dist/data/moon-data-r004.cjs +1 -0
- package/dist/data/moon-data-r004.js +1 -0
- package/dist/data/moon-data-r005.cjs +1 -0
- package/dist/data/moon-data-r005.js +1 -0
- package/dist/data/moon-data-r006.cjs +1 -0
- package/dist/data/moon-data-r006.js +1 -0
- package/dist/data/moon-data-r007.cjs +1 -0
- package/dist/data/moon-data-r007.js +1 -0
- package/dist/data/moon-data-r008.cjs +1 -0
- package/dist/data/moon-data-r008.js +1 -0
- package/dist/data/moon-data-r009.cjs +1 -0
- package/dist/data/moon-data-r009.js +1 -0
- package/dist/data/moon-data-r010.cjs +1 -0
- package/dist/data/moon-data-r010.js +1 -0
- package/dist/data/moon-data-r011.cjs +1 -0
- package/dist/data/moon-data-r011.js +1 -0
- package/dist/data/moon-data-r012.cjs +1 -0
- package/dist/data/moon-data-r012.js +1 -0
- package/dist/data/moon-data-r013.cjs +1 -0
- package/dist/data/moon-data-r013.js +1 -0
- package/dist/data/moon-data-r101.cjs +1 -0
- package/dist/data/moon-data-r101.js +1 -0
- package/dist/data/moon-data-r201.cjs +1 -0
- package/dist/data/moon-data-r201.js +1 -0
- package/dist/data/moon-data-r301.cjs +1 -0
- package/dist/data/moon-data-r301.js +1 -0
- package/dist/data/sun-data-b00.cjs +1 -0
- package/dist/data/sun-data-b00.js +1 -0
- package/dist/data/sun-data-b01.cjs +1 -0
- package/dist/data/sun-data-b01.js +1 -0
- package/dist/data/sun-data-b02.cjs +1 -0
- package/dist/data/sun-data-b02.js +1 -0
- package/dist/data/sun-data-b03.cjs +1 -0
- package/dist/data/sun-data-b03.js +1 -0
- package/dist/data/sun-data-b04.cjs +1 -0
- package/dist/data/sun-data-b04.js +1 -0
- package/dist/data/sun-data-l00.cjs +1 -0
- package/dist/data/sun-data-l00.js +1 -0
- package/dist/data/sun-data-l01.cjs +1 -0
- package/dist/data/sun-data-l01.js +1 -0
- package/dist/data/sun-data-l02.cjs +1 -0
- package/dist/data/sun-data-l02.js +1 -0
- package/dist/data/sun-data-l03.cjs +1 -0
- package/dist/data/sun-data-l03.js +1 -0
- package/dist/data/sun-data-l04.cjs +1 -0
- package/dist/data/sun-data-l04.js +1 -0
- package/dist/data/sun-data-l05.cjs +1 -0
- package/dist/data/sun-data-l05.js +1 -0
- package/dist/data/sun-data-r00.cjs +1 -0
- package/dist/data/sun-data-r00.js +1 -0
- package/dist/data/sun-data-r01.cjs +1 -0
- package/dist/data/sun-data-r01.js +1 -0
- package/dist/data/sun-data-r02.cjs +1 -0
- package/dist/data/sun-data-r02.js +1 -0
- package/dist/data/sun-data-r03.cjs +1 -0
- package/dist/data/sun-data-r03.js +1 -0
- package/dist/data/sun-data-r04.cjs +1 -0
- package/dist/data/sun-data-r04.js +1 -0
- package/dist/data/sun-data-r05.cjs +1 -0
- package/dist/data/sun-data-r05.js +1 -0
- package/dist/extras/fase-bulan.cjs +1 -0
- package/dist/extras/fase-bulan.d.cts +24 -0
- package/dist/extras/fase-bulan.d.ts +24 -0
- package/dist/extras/fase-bulan.js +1 -0
- package/dist/extras/gerhana-bulan-peta.cjs +1 -0
- package/dist/extras/gerhana-bulan-peta.d.cts +30 -0
- package/dist/extras/gerhana-bulan-peta.d.ts +30 -0
- package/dist/extras/gerhana-bulan-peta.js +1 -0
- package/dist/extras/hari-raya.cjs +1 -0
- package/dist/extras/hari-raya.d.cts +55 -0
- package/dist/extras/hari-raya.d.ts +55 -0
- package/dist/extras/hari-raya.js +1 -0
- package/dist/extras/index.d.cts +14 -0
- package/dist/extras/internal.cjs +1 -0
- package/dist/extras/internal.d.cts +21 -0
- package/dist/extras/internal.d.ts +21 -0
- package/dist/extras/internal.js +1 -0
- package/dist/extras/kastner.cjs +2 -0
- package/dist/extras/kastner.d.cts +138 -0
- package/dist/extras/kastner.d.ts +138 -0
- package/dist/extras/kastner.js +2 -0
- package/dist/extras/kurva-visib.cjs +1 -0
- package/dist/extras/kurva-visib.d.cts +145 -0
- package/dist/extras/kurva-visib.d.ts +145 -0
- package/dist/extras/kurva-visib.js +1 -0
- package/dist/extras/vincenty.cjs +1 -0
- package/dist/extras/vincenty.d.cts +32 -0
- package/dist/extras/vincenty.d.ts +32 -0
- package/dist/extras/vincenty.js +1 -0
- package/dist/extras/visibility-engine.cjs +1 -0
- package/dist/extras/visibility-engine.d.cts +187 -0
- package/dist/extras/visibility-engine.d.ts +187 -0
- package/dist/extras/visibility-engine.js +1 -0
- package/dist/index.cjs +1 -2
- package/dist/index.d.cts +64 -2333
- package/dist/index.d.ts +63 -2333
- package/dist/index.js +1 -2
- package/dist/model/awal-bulan/hilal-data.d.cts +15 -0
- package/dist/model/awal-bulan/hilal-data.d.ts +15 -0
- package/dist/model/awal-bulan/hisab-awal-bulan-result.d.cts +23 -0
- package/dist/model/awal-bulan/hisab-awal-bulan-result.d.ts +23 -0
- package/dist/model/awal-bulan/peta-visibilitas-hilal-result.d.cts +30 -0
- package/dist/model/awal-bulan/peta-visibilitas-hilal-result.d.ts +30 -0
- package/dist/model/helper-eclipse/helper-eclipse.d.cts +40 -0
- package/dist/model/helper-eclipse/helper-eclipse.d.ts +40 -0
- package/dist/model/lunar-eclipse/lunar-besselian-result.cjs +1 -0
- package/dist/model/lunar-eclipse/lunar-besselian-result.d.cts +31 -0
- package/dist/model/lunar-eclipse/lunar-besselian-result.d.ts +31 -0
- package/dist/model/lunar-eclipse/lunar-besselian-result.js +1 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-global-range-result.d.cts +21 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-global-range-result.d.ts +21 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-global-result.d.cts +24 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-global-result.d.ts +24 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-local-range-result.d.cts +40 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-local-range-result.d.ts +40 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-local-result.d.cts +40 -0
- package/dist/model/lunar-eclipse/lunar-eclipse-local-result.d.ts +40 -0
- package/dist/model/moon/moon-data-geo.d.cts +21 -0
- package/dist/model/moon/moon-data-geo.d.ts +21 -0
- package/dist/model/moon/moon-data-topo.d.cts +24 -0
- package/dist/model/moon/moon-data-topo.d.ts +24 -0
- package/dist/model/moon/moon-result.d.cts +50 -0
- package/dist/model/moon/moon-result.d.ts +50 -0
- package/dist/model/qibla/qibla-daily-result.d.cts +10 -0
- package/dist/model/qibla/qibla-daily-result.d.ts +10 -0
- package/dist/model/qibla/qibla-event-result.d.cts +7 -0
- package/dist/model/qibla/qibla-event-result.d.ts +7 -0
- package/dist/model/qibla/qibla-moon-yearly-result.d.cts +10 -0
- package/dist/model/qibla/qibla-moon-yearly-result.d.ts +10 -0
- package/dist/model/qibla/qibla-result.d.cts +16 -0
- package/dist/model/qibla/qibla-result.d.ts +16 -0
- package/dist/model/qibla/qibla-yearly-result.d.cts +11 -0
- package/dist/model/qibla/qibla-yearly-result.d.ts +11 -0
- package/dist/model/salat/salat-daily-result.d.cts +12 -0
- package/dist/model/salat/salat-daily-result.d.ts +12 -0
- package/dist/model/salat/salat-status.cjs +1 -0
- package/dist/model/salat/salat-status.d.cts +17 -0
- package/dist/model/salat/salat-status.d.ts +17 -0
- package/dist/model/salat/salat-status.js +1 -0
- package/dist/model/salat/salat-value.cjs +1 -0
- package/dist/model/salat/salat-value.d.cts +12 -0
- package/dist/model/salat/salat-value.d.ts +12 -0
- package/dist/model/salat/salat-value.js +1 -0
- package/dist/model/solar-eclipse/solar-besselian-result.cjs +1 -0
- package/dist/model/solar-eclipse/solar-besselian-result.d.cts +32 -0
- package/dist/model/solar-eclipse/solar-besselian-result.d.ts +32 -0
- package/dist/model/solar-eclipse/solar-besselian-result.js +1 -0
- package/dist/model/solar-eclipse/solar-eclipse-global-range-result.d.cts +80 -0
- package/dist/model/solar-eclipse/solar-eclipse-global-range-result.d.ts +80 -0
- package/dist/model/solar-eclipse/solar-eclipse-global-result.d.cts +80 -0
- package/dist/model/solar-eclipse/solar-eclipse-global-result.d.ts +80 -0
- package/dist/model/solar-eclipse/solar-eclipse-local-range-result.d.cts +35 -0
- package/dist/model/solar-eclipse/solar-eclipse-local-range-result.d.ts +35 -0
- package/dist/model/solar-eclipse/solar-eclipse-local-result.d.cts +35 -0
- package/dist/model/solar-eclipse/solar-eclipse-local-result.d.ts +35 -0
- package/dist/model/sun/sun-data-geo.d.cts +20 -0
- package/dist/model/sun/sun-data-geo.d.ts +20 -0
- package/dist/model/sun/sun-data-topo.d.cts +20 -0
- package/dist/model/sun/sun-data-topo.d.ts +20 -0
- package/dist/model/sun/sun-result.d.cts +38 -0
- package/dist/model/sun/sun-result.d.ts +38 -0
- package/dist/service/calendar-service.cjs +1 -0
- package/dist/service/calendar-service.d.cts +70 -0
- package/dist/service/calendar-service.d.ts +70 -0
- package/dist/service/calendar-service.js +1 -0
- package/dist/service/hisab-awal-bulan-service.cjs +1 -0
- package/dist/service/hisab-awal-bulan-service.d.cts +28 -0
- package/dist/service/hisab-awal-bulan-service.d.ts +28 -0
- package/dist/service/hisab-awal-bulan-service.js +1 -0
- package/dist/service/lunar-eclipse-service.cjs +1 -0
- package/dist/service/lunar-eclipse-service.d.cts +62 -0
- package/dist/service/lunar-eclipse-service.d.ts +62 -0
- package/dist/service/lunar-eclipse-service.js +1 -0
- package/dist/service/moon-service.cjs +1 -0
- package/dist/service/moon-service.d.cts +12 -0
- package/dist/service/moon-service.d.ts +12 -0
- package/dist/service/moon-service.js +1 -0
- package/dist/service/peta-visibilitas-service.cjs +1 -0
- package/dist/service/peta-visibilitas-service.d.cts +33 -0
- package/dist/service/peta-visibilitas-service.d.ts +33 -0
- package/dist/service/peta-visibilitas-service.js +1 -0
- package/dist/service/qibla-service.cjs +1 -0
- package/dist/service/qibla-service.d.cts +67 -0
- package/dist/service/qibla-service.d.ts +67 -0
- package/dist/service/qibla-service.js +1 -0
- package/dist/service/salat-service.cjs +1 -0
- package/dist/service/salat-service.d.cts +67 -0
- package/dist/service/salat-service.d.ts +67 -0
- package/dist/service/salat-service.js +1 -0
- package/dist/service/solar-eclipse-service.cjs +1 -0
- package/dist/service/solar-eclipse-service.d.cts +63 -0
- package/dist/service/solar-eclipse-service.d.ts +63 -0
- package/dist/service/solar-eclipse-service.js +1 -0
- package/dist/service/sun-service.cjs +1 -0
- package/dist/service/sun-service.d.cts +27 -0
- package/dist/service/sun-service.d.ts +27 -0
- package/dist/service/sun-service.js +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../math/math-utils.cjs"),t=require("./dynamical-time.cjs"),n=require("./julian-day.cjs"),r=require("./nutation-meeus.cjs");var i=class{mf=new e.MathFunction;nt=new r.NutationCalculator;dt=new t.DynamicalTime;julianDay=new n.JulianDay;cacheJdL=null;cacheL=null;cacheJdB=null;cacheB=null;cacheJdR=null;cacheR=null;earthHeliocentricLongitude(e){if(this.cacheJdL===e&&this.cacheL!==null)return this.cacheL;let t=(e-2451545)/365250,n=0;n+=0xa739566*Math.cos(0+0*t),n+=3341656*Math.cos(4.6692568+6283.07585*t),n+=34894*Math.cos(4.6261+12566.1517*t),n+=3497*Math.cos(2.7441+5753.3849*t),n+=3418*Math.cos(2.8289+3.5231*t),n+=3136*Math.cos(3.6277+77713.7715*t),n+=2676*Math.cos(4.4181+7860.4194*t),n+=2343*Math.cos(6.1352+3930.2097*t),n+=1324*Math.cos(.7425+11506.7698*t),n+=1273*Math.cos(2.0371+529.691*t),n+=1199*Math.cos(1.1096+1577.3435*t),n+=990*Math.cos(5.233+5884.927*t),n+=902*Math.cos(2.045+26.298*t),n+=857*Math.cos(3.508+398.149*t),n+=780*Math.cos(1.179+5223.694*t),n+=753*Math.cos(2.533+5507.553*t),n+=505*Math.cos(4.583+18849.228*t),n+=492*Math.cos(4.205+775.523*t),n+=357*Math.cos(2.92+.067*t),n+=317*Math.cos(5.849+11790.629*t),n+=284*Math.cos(1.899+796.298*t),n+=271*Math.cos(.315+10977.079*t),n+=243*Math.cos(.345+5486.778*t),n+=206*Math.cos(4.806+2544.314*t),n+=205*Math.cos(1.869+5573.143*t),n+=202*Math.cos(2.458+6069.777*t),n+=156*Math.cos(.833+213.299*t),n+=132*Math.cos(3.411+2942.463*t),n+=126*Math.cos(1.083+20.775*t),n+=115*Math.cos(.645+.98*t),n+=103*Math.cos(.636+4694.003*t),n+=102*Math.cos(.976+15720.839*t),n+=102*Math.cos(4.267+7.114*t),n+=99*Math.cos(6.21+2146.17*t),n+=98*Math.cos(.68+155.42*t),n+=86*Math.cos(5.98+161000.69*t),n+=85*Math.cos(1.3+6275.96*t),n+=85*Math.cos(3.67+71430.7*t),n+=80*Math.cos(1.81+17260.15*t),n+=79*Math.cos(3.04+12036.46*t),n+=75*Math.cos(1.76+5088.63*t),n+=74*Math.cos(3.5+3154.69*t),n+=74*Math.cos(4.68+801.82*t),n+=70*Math.cos(.83+9437.76*t),n+=62*Math.cos(3.98+8827.39*t),n+=61*Math.cos(1.82+7084.9*t),n+=57*Math.cos(2.78+6286.6*t),n+=56*Math.cos(4.39+14143.5*t),n+=56*Math.cos(3.47+6279.55*t),n+=52*Math.cos(.19+12139.55*t),n+=52*Math.cos(1.33+1748.02*t),n+=51*Math.cos(.28+5856.48*t),n+=49*Math.cos(.49+1194.45*t),n+=41*Math.cos(5.37+8429.24*t),n+=41*Math.cos(2.4+19651.05*t),n+=39*Math.cos(6.17+10447.39*t),n+=37*Math.cos(6.04+10213.29*t),n+=37*Math.cos(2.57+1059.38*t),n+=36*Math.cos(1.71+2352.87*t),n+=36*Math.cos(1.78+6812.77*t),n+=33*Math.cos(.59+17789.85*t),n+=30*Math.cos(.44+83996.85*t),n+=30*Math.cos(2.74+1349.87*t),n+=25*Math.cos(3.16+4690.48*t);let r=0;r+=0x924b80f11b*Math.cos(0+0*t),r+=206059*Math.cos(2.678235+6283.07585*t),r+=4303*Math.cos(2.6351+12566.1517*t),r+=425*Math.cos(1.59+3.523*t),r+=119*Math.cos(5.796+26.298*t),r+=109*Math.cos(2.966+1577.344*t),r+=93*Math.cos(2.59+18849.23*t),r+=72*Math.cos(1.14+529.69*t),r+=68*Math.cos(1.87+398.15*t),r+=67*Math.cos(4.41+5507.55*t),r+=59*Math.cos(2.89+5223.69*t),r+=56*Math.cos(2.17+155.42*t),r+=45*Math.cos(.4+796.3*t),r+=36*Math.cos(.47+775.52*t),r+=29*Math.cos(2.65+7.11*t),r+=21*Math.cos(5.34+.98*t),r+=19*Math.cos(1.85+5486.78*t),r+=19*Math.cos(4.97+213.3*t),r+=17*Math.cos(2.99+6275.96*t),r+=16*Math.cos(.03+2544.31*t),r+=16*Math.cos(1.43+2146.17*t),r+=15*Math.cos(1.21+10977.08*t),r+=12*Math.cos(2.83+1748.02*t),r+=12*Math.cos(3.26+5088.63*t),r+=12*Math.cos(5.27+1194.45*t),r+=12*Math.cos(2.08+4694*t),r+=11*Math.cos(.77+553.57*t),r+=10*Math.cos(1.3+6286.6*t),r+=10*Math.cos(4.24+1349.87*t),r+=9*Math.cos(2.7+242.73*t),r+=9*Math.cos(5.64+951.72*t),r+=8*Math.cos(5.3+2352.87*t),r+=6*Math.cos(2.65+9437.76*t),r+=6*Math.cos(4.67+4690.48*t);let i=0;i+=52919*Math.cos(0+0*t),i+=8720*Math.cos(1.0721+6283.0758*t),i+=309*Math.cos(.867+12566.152*t),i+=27*Math.cos(.05+3.52*t),i+=16*Math.cos(5.19+26.3*t),i+=16*Math.cos(3.68+155.42*t),i+=10*Math.cos(.76+18849.23*t),i+=9*Math.cos(2.06+77713.77*t),i+=7*Math.cos(.83+775.52*t),i+=5*Math.cos(4.66+1577.34*t),i+=4*Math.cos(1.03+7.11*t),i+=4*Math.cos(3.44+5573.14*t),i+=3*Math.cos(5.14+796.3*t),i+=3*Math.cos(6.05+5507.55*t),i+=3*Math.cos(1.19+242.73*t),i+=3*Math.cos(6.12+529.69*t),i+=3*Math.cos(.31+398.15*t),i+=3*Math.cos(2.28+553.57*t),i+=2*Math.cos(4.38+5223.69*t),i+=2*Math.cos(3.75+.98*t);let a=0;a+=289*Math.cos(5.844+6283.076*t),a+=35*Math.cos(0+0*t),a+=17*Math.cos(5.49+12566.15*t),a+=3*Math.cos(5.2+155.42*t),a+=+Math.cos(4.72+3.52*t),a+=+Math.cos(5.3+18849.23*t),a+=+Math.cos(5.97+242.73*t);let o=0;o+=114*Math.cos(3.142+0*t),o+=8*Math.cos(4.13+6283.08*t),o+=+Math.cos(3.84+12566.15*t);let s=0;s+=+Math.cos(3.14+0*t);let c=(n+r*t+i*t**2+a*t**3+o*t**4+s*t**5)/1e8;return c=this.mf.deg(c),c=this.mf.mod(c,360),this.cacheJdL=e,this.cacheL=c,c}earthHeliocentricLatitude(e){if(this.cacheJdB===e&&this.cacheB!==null)return this.cacheB;let t=(e-2451545)/365250,n=0;n+=280*Math.cos(3.199+84334.662*t),n+=102*Math.cos(5.422+5507.553*t),n+=80*Math.cos(3.88+5223.69*t),n+=44*Math.cos(3.7+2352.87*t),n+=32*Math.cos(4+1577.34*t);let r=0;r+=9*Math.cos(3.9+5507.55*t),r+=6*Math.cos(1.73+5223.69*t);let i=(n+r*t)/1e8;return i=this.mf.deg(i),this.cacheJdB=e,this.cacheB=i,i}earthRadiusVector(e){if(this.cacheJdR===e&&this.cacheR!==null)return this.cacheR;let t=(e-2451545)/365250,n=0;n+=0x5f617a5*Math.cos(0+0*t),n+=1670700*Math.cos(3.0984635+6283.07585*t),n+=13956*Math.cos(3.05525+12566.1517*t),n+=3084*Math.cos(5.1985+77713.7715*t),n+=1628*Math.cos(1.1739+5753.3849*t),n+=1576*Math.cos(2.8469+7860.4194*t),n+=925*Math.cos(5.453+11506.77*t),n+=542*Math.cos(4.564+3930.21*t),n+=472*Math.cos(3.661+5884.927*t),n+=346*Math.cos(.964+5507.553*t),n+=329*Math.cos(5.9+5223.694*t),n+=307*Math.cos(.299+5573.143*t),n+=243*Math.cos(4.273+11790.629*t),n+=212*Math.cos(5.847+1577.344*t),n+=186*Math.cos(5.022+10977.079*t),n+=175*Math.cos(3.012+18849.228*t),n+=110*Math.cos(5.055+5486.778*t),n+=98*Math.cos(.89+6069.78*t),n+=86*Math.cos(5.69+15720.84*t),n+=86*Math.cos(1.27+161000.69*t),n+=65*Math.cos(.27+17260.15*t),n+=63*Math.cos(.92+529.69*t),n+=57*Math.cos(2.01+83996.85*t),n+=56*Math.cos(5.24+71430.7*t),n+=49*Math.cos(3.25+2544.31*t),n+=47*Math.cos(2.58+775.52*t),n+=45*Math.cos(5.54+9437.76*t),n+=43*Math.cos(6.01+6275.96*t),n+=39*Math.cos(5.36+4694*t),n+=38*Math.cos(2.39+8827.39*t),n+=37*Math.cos(.83+19651.05*t),n+=37*Math.cos(4.9+12139.55*t),n+=36*Math.cos(1.67+12036.46*t),n+=35*Math.cos(1.84+2942.46*t),n+=33*Math.cos(.24+7084.9*t),n+=32*Math.cos(.18+5088.63*t),n+=32*Math.cos(1.78+398.15*t),n+=28*Math.cos(1.21+6286.6*t),n+=28*Math.cos(1.9+6279.55*t),n+=26*Math.cos(4.59+10447.39*t);let r=0;r+=103019*Math.cos(1.10749+6283.07585*t),r+=1721*Math.cos(1.0644+12566.1517*t),r+=702*Math.cos(3.142+0*t),r+=32*Math.cos(1.02+18849.23*t),r+=31*Math.cos(2.84+5507.55*t),r+=25*Math.cos(1.32+5223.69*t),r+=18*Math.cos(1.42+1577.34*t),r+=10*Math.cos(5.91+10977.08*t),r+=9*Math.cos(1.42+6275.96*t),r+=9*Math.cos(.27+5486.78*t);let i=0;i+=4359*Math.cos(5.7846+6283.0758*t),i+=124*Math.cos(5.579+12566.152*t),i+=12*Math.cos(3.14+0*t),i+=9*Math.cos(3.63+77713.77*t),i+=6*Math.cos(1.87+5573.14*t),i+=3*Math.cos(5.47+18849.23*t);let a=0;a+=145*Math.cos(4.273+6283.076*t),a+=7*Math.cos(3.92+12566.15*t);let o=0;o+=4*Math.cos(2.56+6283.08*t);let s=(n+r*t+i*t**2+a*t**3+o*t**4)/1e8;return this.cacheJdR=e,this.cacheR=s,s}sunGeocentricLongitude(e,t,n){let r=this.earthHeliocentricLongitude(e),i=this.earthHeliocentricLatitude(e),a=r+180;a=this.mf.mod(a,360);let o=-i,s=(e-2451545)/36525,c=a-1.397*s-31e-5*s**2,l=(-.09033+.03916*(Math.cos(this.mf.rad(c))+Math.sin(this.mf.rad(c)))*Math.tan(this.mf.rad(o)))/3600,u=a+l,d=this.nt.nutationInLongitude(e),f=-20.489/this.earthRadiusVector(e)/3600,p=u+d+f;return p=this.mf.mod(p,360),n===`True`?u:p}sunGeocentricLatitude(e,t,n){let r=this.earthHeliocentricLongitude(e),i=this.earthHeliocentricLatitude(e),a=r+180;a=this.mf.mod(a,360);let o=-i,s=(e-2451545)/36525,c=a-1.397*s-31e-5*s**2;return o+.03916*(Math.cos(this.mf.rad(c))-Math.sin(this.mf.rad(c)))/3600}sunGeocentricDistance(e,{optResult:t=``}={}){let n=this.earthRadiusVector(e),r;switch(t.replace(/ /g,``).toUpperCase()){case`AU`:r=n;break;case`KM`:r=n*149597870.7;break;case`ER`:r=n*149597870.7/6371;break;default:r=n}return r}sunGeocentricRightAscension(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t,`Appa`),i=this.nt.obliquityOfEcliptic(e);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(n))*Math.cos(this.mf.rad(i))-Math.tan(this.mf.rad(r))*Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(n)))),360)}sunGeocentricDeclination(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t,`Appa`),i=this.nt.obliquityOfEcliptic(e);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.cos(this.mf.rad(i))+Math.cos(this.mf.rad(r))*Math.sin(this.mf.rad(i))*Math.sin(this.mf.rad(n))))}greenwichMeanSiderialTime(e){let t=this.julianDay.jc(e);return this.mf.mod(280.46061837+360.98564736629*(e-2451545)+387933e-9*t**2-t**3/3871e4,360)}greenwichApparentSiderialTime(e,t){let n=this.greenwichMeanSiderialTime(e),r=this.nt.nutationInLongitude(e),i=this.nt.obliquityOfEcliptic(e);return this.mf.mod(n+r*Math.cos(this.mf.rad(i)),360)}localApparentSiderialTime(e,t,n){let r=this.greenwichApparentSiderialTime(e,t);return this.mf.mod(r+n,360)}sunGeocentricGreenwichHourAngle(e,t){let n=this.greenwichApparentSiderialTime(e,t),r=this.sunGeocentricRightAscension(e,t);return this.mf.mod(n-r,360)}sunGeocentricLocalHourAngle(e,t,n){let r=this.greenwichApparentSiderialTime(e,t),i=this.sunGeocentricRightAscension(e,t);return this.mf.mod(r+n-i,360)}sunGeocentricAzimuth(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(i))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(a))*Math.cos(this.mf.rad(r))))+180,360)}sunGeocentricAltitude(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(a))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(i))))}sunGeocentricSemidiameter(e,t){let n=this.earthRadiusVector(e);return(15+59.63/60)/n/60}sunEquatorialHorizontalParallax(e,t){return 8.794/(this.earthRadiusVector(e)*3600)}termU(e){return Math.atan(.99664719*Math.tan(this.mf.rad(e)))}termX(e,t){let n=this.termU(e);return Math.cos(n)+t/6378140*Math.cos(this.mf.rad(e))}termY(e,t){let n=this.termU(e);return .99664719*Math.sin(n)+t/6378140*Math.sin(this.mf.rad(e))}termN(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t,`Appa`),s=this.localApparentSiderialTime(e,t,n),c=this.termX(r,i),l=this.sunEquatorialHorizontalParallax(e,t);return Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))-c*Math.sin(this.mf.rad(l))*Math.cos(this.mf.rad(s))}parallaxInTheSunRightAscension(e,t,n,r,i){let a=this.termX(r,i),o=this.sunEquatorialHorizontalParallax(e,t),s=this.sunGeocentricLocalHourAngle(e,t,n),c=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.atan2(-a*Math.sin(this.mf.rad(o))*Math.sin(this.mf.rad(s)),Math.cos(this.mf.rad(c))-a*Math.sin(this.mf.rad(o))*Math.cos(this.mf.rad(s))))}parallaxInTheSunAltitude(e,t,n,r,i){let a=this.sunGeocentricAltitude(e,t,n,r),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t);return this.mf.deg(Math.sin(Math.sqrt(o*o+s*s)*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(a))))}atmosphericRefractionFromAirlessAltitude(e,t,n){let r=e,i=t,a=n;return(1.02/Math.tan(this.mf.rad(r+10.3/(r+5.11)))*i/1010*283/(273+a)+.0019279204034639303)/60}sunTopocentricLongitude(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t,`Appa`),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.obliquityOfEcliptic(e),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a))*Math.cos(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.sin(this.mf.rad(l))+u*Math.cos(this.mf.rad(l))*Math.sin(this.mf.rad(c))),f)),360)}sunTopocentricLatitude(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunGeocentricLatitude(e,t,`Appa`),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.obliquityOfEcliptic(e),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.deg(Math.atan(Math.cos(this.mf.rad(a))*(Math.sin(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.cos(this.mf.rad(l))-u*Math.sin(this.mf.rad(l))*Math.sin(this.mf.rad(c))))/f))}sunTopocentricRightAscension(e,t,n,r,i){return this.sunGeocentricRightAscension(e,t)+this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricDeclination(e,t,n,r,i){let a=this.sunGeocentricDeclination(e,t),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t),l=this.parallaxInTheSunRightAscension(e,t,n,r,i),u=this.sunGeocentricLocalHourAngle(e,t,n);return this.mf.deg(Math.atan2((Math.sin(this.mf.rad(a))-o*Math.sin(this.mf.rad(c)))*Math.cos(this.mf.rad(l)),Math.cos(this.mf.rad(a))-s*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(u))))}sunTopocentricGreenwichHourAngle(e,t,n,r,i){let a=this.greenwichApparentSiderialTime(e,t),o=this.sunTopocentricRightAscension(e,t,n,r,i);return this.mf.mod(a-o,360)}sunTopocentricLocalHourAngel(e,t,n,r,i){return this.sunGeocentricLocalHourAngle(e,t,n)-this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricAzimuth(e,t,n,r,i){let a=this.sunTopocentricLocalHourAngel(e,t,n,r,i),o=this.sunTopocentricDeclination(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a)),Math.cos(this.mf.rad(a))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(o))*Math.cos(this.mf.rad(r))))+180,360)}sunTopocentricAltitude(e,t,n,r,i,a,o,s){let c=this.sunTopocentricDeclination(e,t,n,r,i),l=this.sunTopocentricLocalHourAngel(e,t,n,r,i),u=1.75/60*Math.sqrt(i),d=this.sunTopocentricSemidiameter(e,t,n,r,i),f=this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(c))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(c))*Math.cos(this.mf.rad(l)))),p=f+d,m=f-d,h=this.atmosphericRefractionFromAirlessAltitude(p,a,o),g=this.atmosphericRefractionFromAirlessAltitude(f,a,o),_=this.atmosphericRefractionFromAirlessAltitude(m,a,o),v=p+h,y=f+g,b=m+_,x=v+u,S=y+u,C=b+u;switch(s){case`htu`:return p;case`htc`:return f;case`htl`:return m;case`htau`:return v;case`htac`:return y;case`htal`:return b;case`htou`:return x;case`htoc`:return S;case`htol`:return C;default:return f}}sunTopocentricSemidiameter(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunTopocentricLatitude(e,t,n,r,i),s=this.sunGeocentricSemidiameter(e,t),c=this.termN(e,t,n,r,i);return this.mf.deg(Math.asin(Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))*Math.sin(this.mf.rad(s))/c))}equationOfTime(e,t){let n=e+t/86400,r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=this.sunGeocentricRightAscension(e,t),o=this.nt.nutationInLongitude(e),s=this.nt.obliquityOfEcliptic(e),c=this.mf.mod(280.4664567+360007.6982779*i+.03032028*i**2+i**3/49931-i**4/15300-i**5/2e6,360)-.0057183-a+o*Math.cos(this.mf.rad(s));return Math.abs(c)*4<20?c/=15:Math.abs(c)*4>=20&&c>0?c=c/15-24:Math.abs(c)*4>=20&&c<0?c=c/15+24:c/=15,c}jdGhurubSyams(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+i/24);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}jdGhurubSyams2(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+0);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}};exports.SunCalculator=i;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { MathFunction } from "../math/math-utils.cjs";
|
|
2
|
+
import { DynamicalTime } from "./dynamical-time.cjs";
|
|
3
|
+
import { JulianDay } from "./julian-day.cjs";
|
|
4
|
+
import { NutationCalculator } from "./nutation-meeus.cjs";
|
|
5
|
+
/** Port `SunCalculator` (persis_times/lib/src/core/astronomy/sun_function_meeus.dart) — posisi Matahari VSOP87 tereduksi (Meeus bab 25 & 32). */
|
|
6
|
+
export declare class SunCalculator {
|
|
7
|
+
readonly mf: MathFunction;
|
|
8
|
+
readonly nt: NutationCalculator;
|
|
9
|
+
readonly dt: DynamicalTime;
|
|
10
|
+
readonly julianDay: JulianDay;
|
|
11
|
+
private cacheJdL;
|
|
12
|
+
private cacheL;
|
|
13
|
+
private cacheJdB;
|
|
14
|
+
private cacheB;
|
|
15
|
+
private cacheJdR;
|
|
16
|
+
private cacheR;
|
|
17
|
+
earthHeliocentricLongitude(jd: number): number;
|
|
18
|
+
earthHeliocentricLatitude(jd: number): number;
|
|
19
|
+
earthRadiusVector(jd: number): number;
|
|
20
|
+
sunGeocentricLongitude(jd: number, deltaT: number, optional: string): number;
|
|
21
|
+
sunGeocentricLatitude(jd: number, deltaT: number, optional: string): number;
|
|
22
|
+
sunGeocentricDistance(jd: number, { optResult }?: {
|
|
23
|
+
optResult?: string;
|
|
24
|
+
}): number;
|
|
25
|
+
sunGeocentricRightAscension(jd: number, deltaT: number): number;
|
|
26
|
+
sunGeocentricDeclination(jd: number, deltaT: number): number;
|
|
27
|
+
greenwichMeanSiderialTime(jd: number): number;
|
|
28
|
+
greenwichApparentSiderialTime(jd: number, deltaT: number): number;
|
|
29
|
+
localApparentSiderialTime(jd: number, deltaT: number, gLon: number): number;
|
|
30
|
+
sunGeocentricGreenwichHourAngle(jd: number, deltaT: number): number;
|
|
31
|
+
sunGeocentricLocalHourAngle(jd: number, deltaT: number, gLon: number): number;
|
|
32
|
+
sunGeocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
33
|
+
sunGeocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
34
|
+
sunGeocentricSemidiameter(jd: number, deltaT: number): number;
|
|
35
|
+
sunEquatorialHorizontalParallax(jd: number, deltaT: number): number;
|
|
36
|
+
termU(gLat: number): number;
|
|
37
|
+
termX(gLat: number, elev: number): number;
|
|
38
|
+
termY(gLat: number, elev: number): number;
|
|
39
|
+
termN(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
40
|
+
parallaxInTheSunRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
41
|
+
parallaxInTheSunAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
42
|
+
atmosphericRefractionFromAirlessAltitude(airlessAltitude: number, pressure: number, temperature: number): number;
|
|
43
|
+
sunTopocentricLongitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
44
|
+
sunTopocentricLatitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
45
|
+
sunTopocentricRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
46
|
+
sunTopocentricDeclination(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
47
|
+
sunTopocentricGreenwichHourAngle(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
48
|
+
sunTopocentricLocalHourAngel(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
49
|
+
sunTopocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
50
|
+
sunTopocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number, pres: number, temp: number, opt: string): number;
|
|
51
|
+
sunTopocentricSemidiameter(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
52
|
+
equationOfTime(jd: number, deltaT: number): number;
|
|
53
|
+
jdGhurubSyams(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
54
|
+
jdGhurubSyams2(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { MathFunction } from "../math/math-utils.js";
|
|
2
|
+
import { DynamicalTime } from "./dynamical-time.js";
|
|
3
|
+
import { JulianDay } from "./julian-day.js";
|
|
4
|
+
import { NutationCalculator } from "./nutation-meeus.js";
|
|
5
|
+
/** Port `SunCalculator` (persis_times/lib/src/core/astronomy/sun_function_meeus.dart) — posisi Matahari VSOP87 tereduksi (Meeus bab 25 & 32). */
|
|
6
|
+
export declare class SunCalculator {
|
|
7
|
+
readonly mf: MathFunction;
|
|
8
|
+
readonly nt: NutationCalculator;
|
|
9
|
+
readonly dt: DynamicalTime;
|
|
10
|
+
readonly julianDay: JulianDay;
|
|
11
|
+
private cacheJdL;
|
|
12
|
+
private cacheL;
|
|
13
|
+
private cacheJdB;
|
|
14
|
+
private cacheB;
|
|
15
|
+
private cacheJdR;
|
|
16
|
+
private cacheR;
|
|
17
|
+
earthHeliocentricLongitude(jd: number): number;
|
|
18
|
+
earthHeliocentricLatitude(jd: number): number;
|
|
19
|
+
earthRadiusVector(jd: number): number;
|
|
20
|
+
sunGeocentricLongitude(jd: number, deltaT: number, optional: string): number;
|
|
21
|
+
sunGeocentricLatitude(jd: number, deltaT: number, optional: string): number;
|
|
22
|
+
sunGeocentricDistance(jd: number, { optResult }?: {
|
|
23
|
+
optResult?: string;
|
|
24
|
+
}): number;
|
|
25
|
+
sunGeocentricRightAscension(jd: number, deltaT: number): number;
|
|
26
|
+
sunGeocentricDeclination(jd: number, deltaT: number): number;
|
|
27
|
+
greenwichMeanSiderialTime(jd: number): number;
|
|
28
|
+
greenwichApparentSiderialTime(jd: number, deltaT: number): number;
|
|
29
|
+
localApparentSiderialTime(jd: number, deltaT: number, gLon: number): number;
|
|
30
|
+
sunGeocentricGreenwichHourAngle(jd: number, deltaT: number): number;
|
|
31
|
+
sunGeocentricLocalHourAngle(jd: number, deltaT: number, gLon: number): number;
|
|
32
|
+
sunGeocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
33
|
+
sunGeocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
34
|
+
sunGeocentricSemidiameter(jd: number, deltaT: number): number;
|
|
35
|
+
sunEquatorialHorizontalParallax(jd: number, deltaT: number): number;
|
|
36
|
+
termU(gLat: number): number;
|
|
37
|
+
termX(gLat: number, elev: number): number;
|
|
38
|
+
termY(gLat: number, elev: number): number;
|
|
39
|
+
termN(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
40
|
+
parallaxInTheSunRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
41
|
+
parallaxInTheSunAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
42
|
+
atmosphericRefractionFromAirlessAltitude(airlessAltitude: number, pressure: number, temperature: number): number;
|
|
43
|
+
sunTopocentricLongitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
44
|
+
sunTopocentricLatitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
45
|
+
sunTopocentricRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
46
|
+
sunTopocentricDeclination(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
47
|
+
sunTopocentricGreenwichHourAngle(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
48
|
+
sunTopocentricLocalHourAngel(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
49
|
+
sunTopocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
50
|
+
sunTopocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number, pres: number, temp: number, opt: string): number;
|
|
51
|
+
sunTopocentricSemidiameter(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
52
|
+
equationOfTime(jd: number, deltaT: number): number;
|
|
53
|
+
jdGhurubSyams(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
54
|
+
jdGhurubSyams2(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MathFunction as e}from"../math/math-utils.js";import{DynamicalTime as t}from"./dynamical-time.js";import{JulianDay as n}from"./julian-day.js";import{NutationCalculator as r}from"./nutation-meeus.js";var i=class{mf=new e;nt=new r;dt=new t;julianDay=new n;cacheJdL=null;cacheL=null;cacheJdB=null;cacheB=null;cacheJdR=null;cacheR=null;earthHeliocentricLongitude(e){if(this.cacheJdL===e&&this.cacheL!==null)return this.cacheL;let t=(e-2451545)/365250,n=0;n+=0xa739566*Math.cos(0+0*t),n+=3341656*Math.cos(4.6692568+6283.07585*t),n+=34894*Math.cos(4.6261+12566.1517*t),n+=3497*Math.cos(2.7441+5753.3849*t),n+=3418*Math.cos(2.8289+3.5231*t),n+=3136*Math.cos(3.6277+77713.7715*t),n+=2676*Math.cos(4.4181+7860.4194*t),n+=2343*Math.cos(6.1352+3930.2097*t),n+=1324*Math.cos(.7425+11506.7698*t),n+=1273*Math.cos(2.0371+529.691*t),n+=1199*Math.cos(1.1096+1577.3435*t),n+=990*Math.cos(5.233+5884.927*t),n+=902*Math.cos(2.045+26.298*t),n+=857*Math.cos(3.508+398.149*t),n+=780*Math.cos(1.179+5223.694*t),n+=753*Math.cos(2.533+5507.553*t),n+=505*Math.cos(4.583+18849.228*t),n+=492*Math.cos(4.205+775.523*t),n+=357*Math.cos(2.92+.067*t),n+=317*Math.cos(5.849+11790.629*t),n+=284*Math.cos(1.899+796.298*t),n+=271*Math.cos(.315+10977.079*t),n+=243*Math.cos(.345+5486.778*t),n+=206*Math.cos(4.806+2544.314*t),n+=205*Math.cos(1.869+5573.143*t),n+=202*Math.cos(2.458+6069.777*t),n+=156*Math.cos(.833+213.299*t),n+=132*Math.cos(3.411+2942.463*t),n+=126*Math.cos(1.083+20.775*t),n+=115*Math.cos(.645+.98*t),n+=103*Math.cos(.636+4694.003*t),n+=102*Math.cos(.976+15720.839*t),n+=102*Math.cos(4.267+7.114*t),n+=99*Math.cos(6.21+2146.17*t),n+=98*Math.cos(.68+155.42*t),n+=86*Math.cos(5.98+161000.69*t),n+=85*Math.cos(1.3+6275.96*t),n+=85*Math.cos(3.67+71430.7*t),n+=80*Math.cos(1.81+17260.15*t),n+=79*Math.cos(3.04+12036.46*t),n+=75*Math.cos(1.76+5088.63*t),n+=74*Math.cos(3.5+3154.69*t),n+=74*Math.cos(4.68+801.82*t),n+=70*Math.cos(.83+9437.76*t),n+=62*Math.cos(3.98+8827.39*t),n+=61*Math.cos(1.82+7084.9*t),n+=57*Math.cos(2.78+6286.6*t),n+=56*Math.cos(4.39+14143.5*t),n+=56*Math.cos(3.47+6279.55*t),n+=52*Math.cos(.19+12139.55*t),n+=52*Math.cos(1.33+1748.02*t),n+=51*Math.cos(.28+5856.48*t),n+=49*Math.cos(.49+1194.45*t),n+=41*Math.cos(5.37+8429.24*t),n+=41*Math.cos(2.4+19651.05*t),n+=39*Math.cos(6.17+10447.39*t),n+=37*Math.cos(6.04+10213.29*t),n+=37*Math.cos(2.57+1059.38*t),n+=36*Math.cos(1.71+2352.87*t),n+=36*Math.cos(1.78+6812.77*t),n+=33*Math.cos(.59+17789.85*t),n+=30*Math.cos(.44+83996.85*t),n+=30*Math.cos(2.74+1349.87*t),n+=25*Math.cos(3.16+4690.48*t);let r=0;r+=0x924b80f11b*Math.cos(0+0*t),r+=206059*Math.cos(2.678235+6283.07585*t),r+=4303*Math.cos(2.6351+12566.1517*t),r+=425*Math.cos(1.59+3.523*t),r+=119*Math.cos(5.796+26.298*t),r+=109*Math.cos(2.966+1577.344*t),r+=93*Math.cos(2.59+18849.23*t),r+=72*Math.cos(1.14+529.69*t),r+=68*Math.cos(1.87+398.15*t),r+=67*Math.cos(4.41+5507.55*t),r+=59*Math.cos(2.89+5223.69*t),r+=56*Math.cos(2.17+155.42*t),r+=45*Math.cos(.4+796.3*t),r+=36*Math.cos(.47+775.52*t),r+=29*Math.cos(2.65+7.11*t),r+=21*Math.cos(5.34+.98*t),r+=19*Math.cos(1.85+5486.78*t),r+=19*Math.cos(4.97+213.3*t),r+=17*Math.cos(2.99+6275.96*t),r+=16*Math.cos(.03+2544.31*t),r+=16*Math.cos(1.43+2146.17*t),r+=15*Math.cos(1.21+10977.08*t),r+=12*Math.cos(2.83+1748.02*t),r+=12*Math.cos(3.26+5088.63*t),r+=12*Math.cos(5.27+1194.45*t),r+=12*Math.cos(2.08+4694*t),r+=11*Math.cos(.77+553.57*t),r+=10*Math.cos(1.3+6286.6*t),r+=10*Math.cos(4.24+1349.87*t),r+=9*Math.cos(2.7+242.73*t),r+=9*Math.cos(5.64+951.72*t),r+=8*Math.cos(5.3+2352.87*t),r+=6*Math.cos(2.65+9437.76*t),r+=6*Math.cos(4.67+4690.48*t);let i=0;i+=52919*Math.cos(0+0*t),i+=8720*Math.cos(1.0721+6283.0758*t),i+=309*Math.cos(.867+12566.152*t),i+=27*Math.cos(.05+3.52*t),i+=16*Math.cos(5.19+26.3*t),i+=16*Math.cos(3.68+155.42*t),i+=10*Math.cos(.76+18849.23*t),i+=9*Math.cos(2.06+77713.77*t),i+=7*Math.cos(.83+775.52*t),i+=5*Math.cos(4.66+1577.34*t),i+=4*Math.cos(1.03+7.11*t),i+=4*Math.cos(3.44+5573.14*t),i+=3*Math.cos(5.14+796.3*t),i+=3*Math.cos(6.05+5507.55*t),i+=3*Math.cos(1.19+242.73*t),i+=3*Math.cos(6.12+529.69*t),i+=3*Math.cos(.31+398.15*t),i+=3*Math.cos(2.28+553.57*t),i+=2*Math.cos(4.38+5223.69*t),i+=2*Math.cos(3.75+.98*t);let a=0;a+=289*Math.cos(5.844+6283.076*t),a+=35*Math.cos(0+0*t),a+=17*Math.cos(5.49+12566.15*t),a+=3*Math.cos(5.2+155.42*t),a+=+Math.cos(4.72+3.52*t),a+=+Math.cos(5.3+18849.23*t),a+=+Math.cos(5.97+242.73*t);let o=0;o+=114*Math.cos(3.142+0*t),o+=8*Math.cos(4.13+6283.08*t),o+=+Math.cos(3.84+12566.15*t);let s=0;s+=+Math.cos(3.14+0*t);let c=(n+r*t+i*t**2+a*t**3+o*t**4+s*t**5)/1e8;return c=this.mf.deg(c),c=this.mf.mod(c,360),this.cacheJdL=e,this.cacheL=c,c}earthHeliocentricLatitude(e){if(this.cacheJdB===e&&this.cacheB!==null)return this.cacheB;let t=(e-2451545)/365250,n=0;n+=280*Math.cos(3.199+84334.662*t),n+=102*Math.cos(5.422+5507.553*t),n+=80*Math.cos(3.88+5223.69*t),n+=44*Math.cos(3.7+2352.87*t),n+=32*Math.cos(4+1577.34*t);let r=0;r+=9*Math.cos(3.9+5507.55*t),r+=6*Math.cos(1.73+5223.69*t);let i=(n+r*t)/1e8;return i=this.mf.deg(i),this.cacheJdB=e,this.cacheB=i,i}earthRadiusVector(e){if(this.cacheJdR===e&&this.cacheR!==null)return this.cacheR;let t=(e-2451545)/365250,n=0;n+=0x5f617a5*Math.cos(0+0*t),n+=1670700*Math.cos(3.0984635+6283.07585*t),n+=13956*Math.cos(3.05525+12566.1517*t),n+=3084*Math.cos(5.1985+77713.7715*t),n+=1628*Math.cos(1.1739+5753.3849*t),n+=1576*Math.cos(2.8469+7860.4194*t),n+=925*Math.cos(5.453+11506.77*t),n+=542*Math.cos(4.564+3930.21*t),n+=472*Math.cos(3.661+5884.927*t),n+=346*Math.cos(.964+5507.553*t),n+=329*Math.cos(5.9+5223.694*t),n+=307*Math.cos(.299+5573.143*t),n+=243*Math.cos(4.273+11790.629*t),n+=212*Math.cos(5.847+1577.344*t),n+=186*Math.cos(5.022+10977.079*t),n+=175*Math.cos(3.012+18849.228*t),n+=110*Math.cos(5.055+5486.778*t),n+=98*Math.cos(.89+6069.78*t),n+=86*Math.cos(5.69+15720.84*t),n+=86*Math.cos(1.27+161000.69*t),n+=65*Math.cos(.27+17260.15*t),n+=63*Math.cos(.92+529.69*t),n+=57*Math.cos(2.01+83996.85*t),n+=56*Math.cos(5.24+71430.7*t),n+=49*Math.cos(3.25+2544.31*t),n+=47*Math.cos(2.58+775.52*t),n+=45*Math.cos(5.54+9437.76*t),n+=43*Math.cos(6.01+6275.96*t),n+=39*Math.cos(5.36+4694*t),n+=38*Math.cos(2.39+8827.39*t),n+=37*Math.cos(.83+19651.05*t),n+=37*Math.cos(4.9+12139.55*t),n+=36*Math.cos(1.67+12036.46*t),n+=35*Math.cos(1.84+2942.46*t),n+=33*Math.cos(.24+7084.9*t),n+=32*Math.cos(.18+5088.63*t),n+=32*Math.cos(1.78+398.15*t),n+=28*Math.cos(1.21+6286.6*t),n+=28*Math.cos(1.9+6279.55*t),n+=26*Math.cos(4.59+10447.39*t);let r=0;r+=103019*Math.cos(1.10749+6283.07585*t),r+=1721*Math.cos(1.0644+12566.1517*t),r+=702*Math.cos(3.142+0*t),r+=32*Math.cos(1.02+18849.23*t),r+=31*Math.cos(2.84+5507.55*t),r+=25*Math.cos(1.32+5223.69*t),r+=18*Math.cos(1.42+1577.34*t),r+=10*Math.cos(5.91+10977.08*t),r+=9*Math.cos(1.42+6275.96*t),r+=9*Math.cos(.27+5486.78*t);let i=0;i+=4359*Math.cos(5.7846+6283.0758*t),i+=124*Math.cos(5.579+12566.152*t),i+=12*Math.cos(3.14+0*t),i+=9*Math.cos(3.63+77713.77*t),i+=6*Math.cos(1.87+5573.14*t),i+=3*Math.cos(5.47+18849.23*t);let a=0;a+=145*Math.cos(4.273+6283.076*t),a+=7*Math.cos(3.92+12566.15*t);let o=0;o+=4*Math.cos(2.56+6283.08*t);let s=(n+r*t+i*t**2+a*t**3+o*t**4)/1e8;return this.cacheJdR=e,this.cacheR=s,s}sunGeocentricLongitude(e,t,n){let r=this.earthHeliocentricLongitude(e),i=this.earthHeliocentricLatitude(e),a=r+180;a=this.mf.mod(a,360);let o=-i,s=(e-2451545)/36525,c=a-1.397*s-31e-5*s**2,l=(-.09033+.03916*(Math.cos(this.mf.rad(c))+Math.sin(this.mf.rad(c)))*Math.tan(this.mf.rad(o)))/3600,u=a+l,d=this.nt.nutationInLongitude(e),f=-20.489/this.earthRadiusVector(e)/3600,p=u+d+f;return p=this.mf.mod(p,360),n===`True`?u:p}sunGeocentricLatitude(e,t,n){let r=this.earthHeliocentricLongitude(e),i=this.earthHeliocentricLatitude(e),a=r+180;a=this.mf.mod(a,360);let o=-i,s=(e-2451545)/36525,c=a-1.397*s-31e-5*s**2;return o+.03916*(Math.cos(this.mf.rad(c))-Math.sin(this.mf.rad(c)))/3600}sunGeocentricDistance(e,{optResult:t=``}={}){let n=this.earthRadiusVector(e),r;switch(t.replace(/ /g,``).toUpperCase()){case`AU`:r=n;break;case`KM`:r=n*149597870.7;break;case`ER`:r=n*149597870.7/6371;break;default:r=n}return r}sunGeocentricRightAscension(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t,`Appa`),i=this.nt.obliquityOfEcliptic(e);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(n))*Math.cos(this.mf.rad(i))-Math.tan(this.mf.rad(r))*Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(n)))),360)}sunGeocentricDeclination(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t,`Appa`),i=this.nt.obliquityOfEcliptic(e);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.cos(this.mf.rad(i))+Math.cos(this.mf.rad(r))*Math.sin(this.mf.rad(i))*Math.sin(this.mf.rad(n))))}greenwichMeanSiderialTime(e){let t=this.julianDay.jc(e);return this.mf.mod(280.46061837+360.98564736629*(e-2451545)+387933e-9*t**2-t**3/3871e4,360)}greenwichApparentSiderialTime(e,t){let n=this.greenwichMeanSiderialTime(e),r=this.nt.nutationInLongitude(e),i=this.nt.obliquityOfEcliptic(e);return this.mf.mod(n+r*Math.cos(this.mf.rad(i)),360)}localApparentSiderialTime(e,t,n){let r=this.greenwichApparentSiderialTime(e,t);return this.mf.mod(r+n,360)}sunGeocentricGreenwichHourAngle(e,t){let n=this.greenwichApparentSiderialTime(e,t),r=this.sunGeocentricRightAscension(e,t);return this.mf.mod(n-r,360)}sunGeocentricLocalHourAngle(e,t,n){let r=this.greenwichApparentSiderialTime(e,t),i=this.sunGeocentricRightAscension(e,t);return this.mf.mod(r+n-i,360)}sunGeocentricAzimuth(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(i))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(a))*Math.cos(this.mf.rad(r))))+180,360)}sunGeocentricAltitude(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(a))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(i))))}sunGeocentricSemidiameter(e,t){let n=this.earthRadiusVector(e);return(15+59.63/60)/n/60}sunEquatorialHorizontalParallax(e,t){return 8.794/(this.earthRadiusVector(e)*3600)}termU(e){return Math.atan(.99664719*Math.tan(this.mf.rad(e)))}termX(e,t){let n=this.termU(e);return Math.cos(n)+t/6378140*Math.cos(this.mf.rad(e))}termY(e,t){let n=this.termU(e);return .99664719*Math.sin(n)+t/6378140*Math.sin(this.mf.rad(e))}termN(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t,`Appa`),s=this.localApparentSiderialTime(e,t,n),c=this.termX(r,i),l=this.sunEquatorialHorizontalParallax(e,t);return Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))-c*Math.sin(this.mf.rad(l))*Math.cos(this.mf.rad(s))}parallaxInTheSunRightAscension(e,t,n,r,i){let a=this.termX(r,i),o=this.sunEquatorialHorizontalParallax(e,t),s=this.sunGeocentricLocalHourAngle(e,t,n),c=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.atan2(-a*Math.sin(this.mf.rad(o))*Math.sin(this.mf.rad(s)),Math.cos(this.mf.rad(c))-a*Math.sin(this.mf.rad(o))*Math.cos(this.mf.rad(s))))}parallaxInTheSunAltitude(e,t,n,r,i){let a=this.sunGeocentricAltitude(e,t,n,r),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t);return this.mf.deg(Math.sin(Math.sqrt(o*o+s*s)*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(a))))}atmosphericRefractionFromAirlessAltitude(e,t,n){let r=e,i=t,a=n;return(1.02/Math.tan(this.mf.rad(r+10.3/(r+5.11)))*i/1010*283/(273+a)+.0019279204034639303)/60}sunTopocentricLongitude(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t,`Appa`),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.obliquityOfEcliptic(e),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a))*Math.cos(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.sin(this.mf.rad(l))+u*Math.cos(this.mf.rad(l))*Math.sin(this.mf.rad(c))),f)),360)}sunTopocentricLatitude(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunGeocentricLatitude(e,t,`Appa`),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.obliquityOfEcliptic(e),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.deg(Math.atan(Math.cos(this.mf.rad(a))*(Math.sin(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.cos(this.mf.rad(l))-u*Math.sin(this.mf.rad(l))*Math.sin(this.mf.rad(c))))/f))}sunTopocentricRightAscension(e,t,n,r,i){return this.sunGeocentricRightAscension(e,t)+this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricDeclination(e,t,n,r,i){let a=this.sunGeocentricDeclination(e,t),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t),l=this.parallaxInTheSunRightAscension(e,t,n,r,i),u=this.sunGeocentricLocalHourAngle(e,t,n);return this.mf.deg(Math.atan2((Math.sin(this.mf.rad(a))-o*Math.sin(this.mf.rad(c)))*Math.cos(this.mf.rad(l)),Math.cos(this.mf.rad(a))-s*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(u))))}sunTopocentricGreenwichHourAngle(e,t,n,r,i){let a=this.greenwichApparentSiderialTime(e,t),o=this.sunTopocentricRightAscension(e,t,n,r,i);return this.mf.mod(a-o,360)}sunTopocentricLocalHourAngel(e,t,n,r,i){return this.sunGeocentricLocalHourAngle(e,t,n)-this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricAzimuth(e,t,n,r,i){let a=this.sunTopocentricLocalHourAngel(e,t,n,r,i),o=this.sunTopocentricDeclination(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a)),Math.cos(this.mf.rad(a))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(o))*Math.cos(this.mf.rad(r))))+180,360)}sunTopocentricAltitude(e,t,n,r,i,a,o,s){let c=this.sunTopocentricDeclination(e,t,n,r,i),l=this.sunTopocentricLocalHourAngel(e,t,n,r,i),u=1.75/60*Math.sqrt(i),d=this.sunTopocentricSemidiameter(e,t,n,r,i),f=this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(c))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(c))*Math.cos(this.mf.rad(l)))),p=f+d,m=f-d,h=this.atmosphericRefractionFromAirlessAltitude(p,a,o),g=this.atmosphericRefractionFromAirlessAltitude(f,a,o),_=this.atmosphericRefractionFromAirlessAltitude(m,a,o),v=p+h,y=f+g,b=m+_,x=v+u,S=y+u,C=b+u;switch(s){case`htu`:return p;case`htc`:return f;case`htl`:return m;case`htau`:return v;case`htac`:return y;case`htal`:return b;case`htou`:return x;case`htoc`:return S;case`htol`:return C;default:return f}}sunTopocentricSemidiameter(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunTopocentricLatitude(e,t,n,r,i),s=this.sunGeocentricSemidiameter(e,t),c=this.termN(e,t,n,r,i);return this.mf.deg(Math.asin(Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))*Math.sin(this.mf.rad(s))/c))}equationOfTime(e,t){let n=e+t/86400,r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=this.sunGeocentricRightAscension(e,t),o=this.nt.nutationInLongitude(e),s=this.nt.obliquityOfEcliptic(e),c=this.mf.mod(280.4664567+360007.6982779*i+.03032028*i**2+i**3/49931-i**4/15300-i**5/2e6,360)-.0057183-a+o*Math.cos(this.mf.rad(s));return Math.abs(c)*4<20?c/=15:Math.abs(c)*4>=20&&c>0?c=c/15-24:Math.abs(c)*4>=20&&c<0?c=c/15+24:c/=15,c}jdGhurubSyams(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+i/24);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}jdGhurubSyams2(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+0);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}};export{i as SunCalculator};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../math/math-utils.cjs"),t=require("./dynamical-time.cjs"),n=require("./julian-day.cjs"),r=require("./nutation.cjs"),i=require("../../data/sun-data-l00.cjs"),a=require("../../data/sun-data-l01.cjs"),o=require("../../data/sun-data-l02.cjs"),s=require("../../data/sun-data-l03.cjs"),c=require("../../data/sun-data-l04.cjs"),l=require("../../data/sun-data-l05.cjs"),u=require("../../data/sun-data-b00.cjs"),d=require("../../data/sun-data-b01.cjs"),f=require("../../data/sun-data-b02.cjs"),p=require("../../data/sun-data-b03.cjs"),m=require("../../data/sun-data-b04.cjs"),h=require("../../data/sun-data-r00.cjs"),g=require("../../data/sun-data-r01.cjs"),_=require("../../data/sun-data-r02.cjs"),v=require("../../data/sun-data-r03.cjs"),y=require("../../data/sun-data-r04.cjs"),b=require("../../data/sun-data-r05.cjs");var x=class{l00=i.SunDataL00.vsop87MtL0;l01=a.SunDataL01.vsop87MtL1;l02=o.SunDataL02.vsop87MtL2;l03=s.SunDataL03.vsop87MtL3;l04=c.SunDataL04.vsop87MtL4;l05=l.SunDataL05.vsop87MtL5;b00=u.SunDataB00.vsop87MtB0;b01=d.SunDataB01.vsop87MtB1;b02=f.SunDataB02.vsop87MtB2;b03=p.SunDataB03.vsop87MtB3;b04=m.SunDataB04.vsop87MtB4;r00=h.SunDataR00.vsop87MtR0;r01=g.SunDataR01.vsop87MtR1;r02=_.SunDataR02.vsop87MtR2;r03=v.SunDataR03.vsop87MtR3;r04=y.SunDataR04.vsop87MtR4;r05=b.SunDataR05.vsop87MtR5;mf=new e.MathFunction;julianDay=new n.JulianDay;nt=new r.NutationAndObliquity;dt=new t.DynamicalTime;_cacheJdeL=null;_cacheL=null;_cacheJdeB=null;_cacheB=null;_cacheJdeR=null;_cacheR=null;earthHeliocentricLongitude(e,t){let n=e+t/86400;if(this._cacheJdeL===n&&this._cacheL!==null)return this._cacheL;let r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=0;for(let e=0;e<559;e++)a+=this.l00[e][0]*Math.cos(this.l00[e][1]+this.l00[e][2]*i);let o=0;for(let e=0;e<341;e++)o+=this.l01[e][0]*Math.cos(this.l01[e][1]+this.l01[e][2]*i);let s=0;for(let e=0;e<142;e++)s+=this.l02[e][0]*Math.cos(this.l02[e][1]+this.l02[e][2]*i);let c=0;for(let e=0;e<22;e++)c+=this.l03[e][0]*Math.cos(this.l03[e][1]+this.l03[e][2]*i);let l=0;for(let e=0;e<11;e++)l+=this.l04[e][0]*Math.cos(this.l04[e][1]+this.l04[e][2]*i);let u=0;for(let e=0;e<5;e++)u+=this.l05[e][0]*Math.cos(this.l05[e][1]+this.l05[e][2]*i);let d=this.mf.mod(this.mf.deg(a+o*i+s*i**2+c*i**3+l*i**4+u*i**5),360);return this._cacheJdeL=n,this._cacheL=d,d}earthHeliocentricLatitude(e,t){let n=e+t/86400;if(this._cacheJdeB===n&&this._cacheB!==null)return this._cacheB;let r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=0;for(let e=0;e<184;e++)a+=this.b00[e][0]*Math.cos(this.b00[e][1]+this.b00[e][2]*i);let o=0;for(let e=0;e<99;e++)o+=this.b01[e][0]*Math.cos(this.b01[e][1]+this.b01[e][2]*i);let s=0;for(let e=0;e<49;e++)s+=this.b02[e][0]*Math.cos(this.b02[e][1]+this.b02[e][2]*i);let c=0;for(let e=0;e<11;e++)c+=this.b03[e][0]*Math.cos(this.b03[e][1]+this.b03[e][2]*i);let l=0;for(let e=0;e<5;e++)l+=this.b04[e][0]*Math.cos(this.b04[e][1]+this.b04[e][2]*i);let u=this.mf.deg(a+o*i+s*i**2+c*i**3+l*i**4);return this._cacheJdeB=n,this._cacheB=u,u}earthRadiusVector(e,t){let n=e+t/86400;if(this._cacheJdeR===n&&this._cacheR!==null)return this._cacheR;let r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=0;for(let e=0;e<526;e++)a+=this.r00[e][0]*Math.cos(this.r00[e][1]+this.r00[e][2]*i);let o=0;for(let e=0;e<292;e++)o+=this.r01[e][0]*Math.cos(this.r01[e][1]+this.r01[e][2]*i);let s=0;for(let e=0;e<139;e++)s+=this.r02[e][0]*Math.cos(this.r02[e][1]+this.r02[e][2]*i);let c=0;for(let e=0;e<27;e++)c+=this.r03[e][0]*Math.cos(this.r03[e][1]+this.r03[e][2]*i);let l=0;for(let e=0;e<10;e++)l+=this.r04[e][0]*Math.cos(this.r04[e][1]+this.r04[e][2]*i);let u=0;for(let e=0;e<3;e++)u+=this.r05[e][0]*Math.cos(this.r05[e][1]+this.r05[e][2]*i);let d=a+o*i+s*i**2+c*i**3+l*i**4+u*i**5;return this._cacheJdeR=n,this._cacheR=d,d}sunGeocentricLongitude(e,t,n){let r=this.earthHeliocentricLongitude(e,t),i=this.earthHeliocentricLatitude(e,t),a=this.mf.mod(r+180,360),o=-i,s=e+t/86400,c=this.julianDay.jc(s),l=this.mf.mod(a-1.397*c-31e-5*c*c,360),u=a+(-.09033+.03916*(Math.cos(this.mf.rad(l))+Math.sin(this.mf.rad(l)))*Math.tan(this.mf.rad(o)))/3600,d=this.nt.nutationInLongitude(e,t),f=this.sunAberration(e,t)/3600,p=this.mf.mod(u+d+f,360);return n===`True`?u:p}sunGeocentricLatitude(e,t){let n=this.earthHeliocentricLongitude(e,t),r=this.earthHeliocentricLatitude(e,t),i=this.mf.mod(n+180,360),a=-r,o=e+t/86400,s=this.julianDay.jce(o),c=i-1.397*s-31e-5*s*s;return a+.03916*(Math.cos(this.mf.rad(c))-Math.sin(this.mf.rad(c)))/3600}sunGeocentricDistance(e,t,n){let r=this.earthRadiusVector(e,t),i=r,a=r*149597870.7,o=r*149597870.7/6371;switch(n){case`AU`:return i;case`KM`:return a;case`ER`:return o;default:return i}}sunAberration(e,t){let n=e+t/86400,r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=3548.33+118.568*Math.sin(this.mf.rad(87.5287+359993.7286*i))+2.476*Math.sin(this.mf.rad(85.0561+719987.4571*i))+1.376*Math.sin(this.mf.rad(27.8502+4452671.1152*i))+.119*Math.sin(this.mf.rad(73.1375+450368.8564*i))+.114*Math.sin(this.mf.rad(337.2264+329644.6718*i))+.086*Math.sin(this.mf.rad(222.54+659289.3436*i))+.078*Math.sin(this.mf.rad(162.8136+9224659.7915*i))+.054*Math.sin(this.mf.rad(82.5823+1079981.1857*i))+.052*Math.sin(this.mf.rad(171.5189+225184.4282*i))+.034*Math.sin(this.mf.rad(30.3214+4092677.3866*i))+.033*Math.sin(this.mf.rad(119.8105+337181.4711*i))+.023*Math.sin(this.mf.rad(247.5418+299295.6151*i))+.023*Math.sin(this.mf.rad(325.1526+315559.556*i))+.021*Math.sin(this.mf.rad(155.1241+675553.2846*i))+7.311*i*Math.sin(this.mf.rad(333.4515+359993.7286*i))+.305*i*Math.sin(this.mf.rad(330.9814+719987.4571*i))+.01*i*Math.sin(this.mf.rad(328.517+1079981.1857*i))+.309*i*i*Math.sin(this.mf.rad(241.4518+359993.7286*i))+.021*i*i*Math.sin(this.mf.rad(205.0482+719987.4571*i))+.004*i*i*Math.sin(this.mf.rad(297.861+4452671.1152*i))+.01*i*i*i*Math.sin(this.mf.rad(154.7066+359993.7286*i));return-.005775518*this.sunGeocentricDistance(e,t,`AU`)*a}sunGeocentricRightAscension(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t),i=this.nt.trueObliquityOfEcliptic(e,t);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(n))*Math.cos(this.mf.rad(i))-Math.tan(this.mf.rad(r))*Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(n)))),360)}sunGeocentricDeclination(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t),i=this.nt.trueObliquityOfEcliptic(e,t);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.cos(this.mf.rad(i))+Math.cos(this.mf.rad(r))*Math.sin(this.mf.rad(i))*Math.sin(this.mf.rad(n))))}greenwichMeanSiderialTime(e){let t=this.julianDay.jc(e);return this.mf.mod(280.46061837+360.98564736629*(e-2451545)+387933e-9*t**2-t**3/3871e4,360)}greenwichApparentSiderialTime(e,t){let n=this.greenwichMeanSiderialTime(e),r=this.nt.nutationInLongitude(e,t),i=this.nt.trueObliquityOfEcliptic(e,t);return this.mf.mod(n+r*Math.cos(this.mf.rad(i)),360)}localApparentSiderialTime(e,t,n){let r=this.greenwichApparentSiderialTime(e,t);return this.mf.mod(r+n,360)}sunGeocentricGreenwichHourAngle(e,t){let n=this.greenwichApparentSiderialTime(e,t),r=this.sunGeocentricRightAscension(e,t);return this.mf.mod(n-r,360)}sunGeocentricLocalHourAngle(e,t,n){let r=this.greenwichApparentSiderialTime(e,t),i=this.sunGeocentricRightAscension(e,t);return this.mf.mod(r+n-i,360)}sunGeocentricAzimuth(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(i))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(a))*Math.cos(this.mf.rad(r))))+180,360)}sunGeocentricAltitude(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(a))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(i))))}sunGeocentricSemidiameter(e,t){let n=this.earthRadiusVector(e,t);return(15+59.63/60)/n/60}sunEquatorialHorizontalParallax(e,t){return 8.794/(this.earthRadiusVector(e,t)*3600)}termU(e){return Math.atan(.99664719*Math.tan(this.mf.rad(e)))}termX(e,t){let n=this.termU(e);return Math.cos(n)+t/6378140*Math.cos(this.mf.rad(e))}termY(e,t){let n=this.termU(e);return .99664719*Math.sin(n)+t/6378140*Math.sin(this.mf.rad(e))}termN(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t),s=this.localApparentSiderialTime(e,t,n),c=this.termX(r,i),l=this.sunEquatorialHorizontalParallax(e,t);return Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))-c*Math.sin(this.mf.rad(l))*Math.cos(this.mf.rad(s))}parallaxInTheSunRightAscension(e,t,n,r,i){let a=this.termX(r,i),o=this.sunEquatorialHorizontalParallax(e,t),s=this.sunGeocentricLocalHourAngle(e,t,n),c=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.atan2(-a*Math.sin(this.mf.rad(o))*Math.sin(this.mf.rad(s)),Math.cos(this.mf.rad(c))-a*Math.sin(this.mf.rad(o))*Math.cos(this.mf.rad(s))))}parallaxInTheSunAltitude(e,t,n,r,i){let a=this.sunGeocentricAltitude(e,t,n,r),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t);return this.mf.deg(Math.sin(Math.sqrt(o*o+s*s)*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(a))))}atmosphericRefractionFromAirlessAltitude(e,t,n){let r=e,i=t,a=n;return(1.02/Math.tan(this.mf.rad(r+10.3/(r+5.11)))*i/1010*283/(273+a)+.0019279204034639303)/60}sunTopocentricLongitude(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.trueObliquityOfEcliptic(e,t),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a))*Math.cos(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.sin(this.mf.rad(l))+u*Math.cos(this.mf.rad(l))*Math.sin(this.mf.rad(c))),f)),360)}sunTopocentricLatitude(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunGeocentricLatitude(e,t),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.trueObliquityOfEcliptic(e,t),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.deg(Math.atan(Math.cos(this.mf.rad(a))*(Math.sin(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.cos(this.mf.rad(l))-u*Math.sin(this.mf.rad(l))*Math.sin(this.mf.rad(c))))/f))}sunTopocentricRightAscension(e,t,n,r,i){return this.sunGeocentricRightAscension(e,t)+this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricDeclination(e,t,n,r,i){let a=this.sunGeocentricDeclination(e,t),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t),l=this.parallaxInTheSunRightAscension(e,t,n,r,i),u=this.sunGeocentricLocalHourAngle(e,t,n);return this.mf.deg(Math.atan2((Math.sin(this.mf.rad(a))-o*Math.sin(this.mf.rad(c)))*Math.cos(this.mf.rad(l)),Math.cos(this.mf.rad(a))-s*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(u))))}sunTopocentricGreenwichHourAngle(e,t,n,r,i){let a=this.greenwichApparentSiderialTime(e,t),o=this.sunTopocentricRightAscension(e,t,n,r,i);return this.mf.mod(a-o,360)}sunTopocentricLocalHourAngel(e,t,n,r,i){return this.sunGeocentricLocalHourAngle(e,t,n)-this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricAzimuth(e,t,n,r,i){let a=this.sunTopocentricLocalHourAngel(e,t,n,r,i),o=this.sunTopocentricDeclination(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a)),Math.cos(this.mf.rad(a))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(o))*Math.cos(this.mf.rad(r))))+180,360)}sunTopocentricAltitude(e,t,n,r,i,a,o,s){let c=this.sunTopocentricDeclination(e,t,n,r,i),l=this.sunTopocentricLocalHourAngel(e,t,n,r,i),u=1.75/60*Math.sqrt(i),d=this.sunTopocentricSemidiameter(e,t,n,r,i),f=this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(c))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(c))*Math.cos(this.mf.rad(l)))),p=f+d,m=f-d,h=this.atmosphericRefractionFromAirlessAltitude(p,a,o),g=this.atmosphericRefractionFromAirlessAltitude(f,a,o),_=this.atmosphericRefractionFromAirlessAltitude(m,a,o),v=p+h,y=f+g,b=m+_,x=v+u,S=y+u,C=b+u;switch(s){case`htu`:return p;case`htc`:return f;case`htl`:return m;case`htau`:return v;case`htac`:return y;case`htal`:return b;case`htou`:return x;case`htoc`:return S;case`htol`:return C;default:return f}}sunTopocentricSemidiameter(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunTopocentricLatitude(e,t,n,r,i),s=this.sunGeocentricSemidiameter(e,t),c=this.termN(e,t,n,r,i);return this.mf.deg(Math.asin(Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))*Math.sin(this.mf.rad(s))/c))}equationOfTime(e,t){let n=e+t/86400,r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=this.sunGeocentricRightAscension(e,t),o=this.nt.nutationInLongitude(e,t),s=this.nt.trueObliquityOfEcliptic(e,t),c=this.mf.mod(280.4664567+360007.6982779*i+.03032028*i**2+i**3/49931-i**4/15300-i**5/2e6,360)-.0057183-a+o*Math.cos(this.mf.rad(s));return Math.abs(c)*4<20?c/=15:Math.abs(c)*4>=20&&c>0?c=c/15-24:Math.abs(c)*4>=20&&c<0?c=c/15+24:c/=15,c}jdGhurubSyams(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+i/24);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}jdGhurubSyams2(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+0);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}};exports.SunFunction=x;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { MathFunction } from "../math/math-utils.cjs";
|
|
2
|
+
import { DynamicalTime } from "./dynamical-time.cjs";
|
|
3
|
+
import { JulianDay } from "./julian-day.cjs";
|
|
4
|
+
import { NutationAndObliquity } from "./nutation.cjs";
|
|
5
|
+
/**
|
|
6
|
+
* Port `SunFunction` (persis_times/lib/src/core/astronomy/sun_function.dart).
|
|
7
|
+
* Posisi Matahari VSOP87D (Meeus, Astronomical Algorithms bab 25/32) dengan cache 1-slot per seri L/B/R.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SunFunction {
|
|
10
|
+
readonly l00: readonly (readonly number[])[];
|
|
11
|
+
readonly l01: readonly (readonly number[])[];
|
|
12
|
+
readonly l02: readonly (readonly number[])[];
|
|
13
|
+
readonly l03: readonly (readonly number[])[];
|
|
14
|
+
readonly l04: readonly (readonly number[])[];
|
|
15
|
+
readonly l05: readonly (readonly number[])[];
|
|
16
|
+
readonly b00: readonly (readonly number[])[];
|
|
17
|
+
readonly b01: readonly (readonly number[])[];
|
|
18
|
+
readonly b02: readonly (readonly number[])[];
|
|
19
|
+
readonly b03: readonly (readonly number[])[];
|
|
20
|
+
readonly b04: readonly (readonly number[])[];
|
|
21
|
+
readonly r00: readonly (readonly number[])[];
|
|
22
|
+
readonly r01: readonly (readonly number[])[];
|
|
23
|
+
readonly r02: readonly (readonly number[])[];
|
|
24
|
+
readonly r03: readonly (readonly number[])[];
|
|
25
|
+
readonly r04: readonly (readonly number[])[];
|
|
26
|
+
readonly r05: readonly (readonly number[])[];
|
|
27
|
+
readonly mf: MathFunction;
|
|
28
|
+
readonly julianDay: JulianDay;
|
|
29
|
+
readonly nt: NutationAndObliquity;
|
|
30
|
+
readonly dt: DynamicalTime;
|
|
31
|
+
private _cacheJdeL;
|
|
32
|
+
private _cacheL;
|
|
33
|
+
private _cacheJdeB;
|
|
34
|
+
private _cacheB;
|
|
35
|
+
private _cacheJdeR;
|
|
36
|
+
private _cacheR;
|
|
37
|
+
earthHeliocentricLongitude(jd: number, deltaT: number): number;
|
|
38
|
+
earthHeliocentricLatitude(jd: number, deltaT: number): number;
|
|
39
|
+
earthRadiusVector(jd: number, deltaT: number): number;
|
|
40
|
+
sunGeocentricLongitude(jd: number, deltaT: number, optional: string): number;
|
|
41
|
+
sunGeocentricLatitude(jd: number, deltaT: number): number;
|
|
42
|
+
sunGeocentricDistance(jd: number, deltaT: number, opt: string): number;
|
|
43
|
+
sunAberration(jd: number, deltaT: number): number;
|
|
44
|
+
sunGeocentricRightAscension(jd: number, deltaT: number): number;
|
|
45
|
+
sunGeocentricDeclination(jd: number, deltaT: number): number;
|
|
46
|
+
greenwichMeanSiderialTime(jd: number): number;
|
|
47
|
+
greenwichApparentSiderialTime(jd: number, deltaT: number): number;
|
|
48
|
+
localApparentSiderialTime(jd: number, deltaT: number, gLon: number): number;
|
|
49
|
+
sunGeocentricGreenwichHourAngle(jd: number, deltaT: number): number;
|
|
50
|
+
sunGeocentricLocalHourAngle(jd: number, deltaT: number, gLon: number): number;
|
|
51
|
+
sunGeocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
52
|
+
sunGeocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
53
|
+
sunGeocentricSemidiameter(jd: number, deltaT: number): number;
|
|
54
|
+
sunEquatorialHorizontalParallax(jd: number, deltaT: number): number;
|
|
55
|
+
termU(gLat: number): number;
|
|
56
|
+
termX(gLat: number, elev: number): number;
|
|
57
|
+
termY(gLat: number, elev: number): number;
|
|
58
|
+
termN(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
59
|
+
parallaxInTheSunRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
60
|
+
parallaxInTheSunAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
61
|
+
atmosphericRefractionFromAirlessAltitude(airlessAltitude: number, pressure: number, temperature: number): number;
|
|
62
|
+
sunTopocentricLongitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
63
|
+
sunTopocentricLatitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
64
|
+
sunTopocentricRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
65
|
+
sunTopocentricDeclination(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
66
|
+
sunTopocentricGreenwichHourAngle(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
67
|
+
sunTopocentricLocalHourAngel(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
68
|
+
sunTopocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
69
|
+
sunTopocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number, pres: number, temp: number, opt: string): number;
|
|
70
|
+
sunTopocentricSemidiameter(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
71
|
+
equationOfTime(jd: number, deltaT: number): number;
|
|
72
|
+
jdGhurubSyams(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
73
|
+
jdGhurubSyams2(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
74
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { MathFunction } from "../math/math-utils.js";
|
|
2
|
+
import { DynamicalTime } from "./dynamical-time.js";
|
|
3
|
+
import { JulianDay } from "./julian-day.js";
|
|
4
|
+
import { NutationAndObliquity } from "./nutation.js";
|
|
5
|
+
/**
|
|
6
|
+
* Port `SunFunction` (persis_times/lib/src/core/astronomy/sun_function.dart).
|
|
7
|
+
* Posisi Matahari VSOP87D (Meeus, Astronomical Algorithms bab 25/32) dengan cache 1-slot per seri L/B/R.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SunFunction {
|
|
10
|
+
readonly l00: readonly (readonly number[])[];
|
|
11
|
+
readonly l01: readonly (readonly number[])[];
|
|
12
|
+
readonly l02: readonly (readonly number[])[];
|
|
13
|
+
readonly l03: readonly (readonly number[])[];
|
|
14
|
+
readonly l04: readonly (readonly number[])[];
|
|
15
|
+
readonly l05: readonly (readonly number[])[];
|
|
16
|
+
readonly b00: readonly (readonly number[])[];
|
|
17
|
+
readonly b01: readonly (readonly number[])[];
|
|
18
|
+
readonly b02: readonly (readonly number[])[];
|
|
19
|
+
readonly b03: readonly (readonly number[])[];
|
|
20
|
+
readonly b04: readonly (readonly number[])[];
|
|
21
|
+
readonly r00: readonly (readonly number[])[];
|
|
22
|
+
readonly r01: readonly (readonly number[])[];
|
|
23
|
+
readonly r02: readonly (readonly number[])[];
|
|
24
|
+
readonly r03: readonly (readonly number[])[];
|
|
25
|
+
readonly r04: readonly (readonly number[])[];
|
|
26
|
+
readonly r05: readonly (readonly number[])[];
|
|
27
|
+
readonly mf: MathFunction;
|
|
28
|
+
readonly julianDay: JulianDay;
|
|
29
|
+
readonly nt: NutationAndObliquity;
|
|
30
|
+
readonly dt: DynamicalTime;
|
|
31
|
+
private _cacheJdeL;
|
|
32
|
+
private _cacheL;
|
|
33
|
+
private _cacheJdeB;
|
|
34
|
+
private _cacheB;
|
|
35
|
+
private _cacheJdeR;
|
|
36
|
+
private _cacheR;
|
|
37
|
+
earthHeliocentricLongitude(jd: number, deltaT: number): number;
|
|
38
|
+
earthHeliocentricLatitude(jd: number, deltaT: number): number;
|
|
39
|
+
earthRadiusVector(jd: number, deltaT: number): number;
|
|
40
|
+
sunGeocentricLongitude(jd: number, deltaT: number, optional: string): number;
|
|
41
|
+
sunGeocentricLatitude(jd: number, deltaT: number): number;
|
|
42
|
+
sunGeocentricDistance(jd: number, deltaT: number, opt: string): number;
|
|
43
|
+
sunAberration(jd: number, deltaT: number): number;
|
|
44
|
+
sunGeocentricRightAscension(jd: number, deltaT: number): number;
|
|
45
|
+
sunGeocentricDeclination(jd: number, deltaT: number): number;
|
|
46
|
+
greenwichMeanSiderialTime(jd: number): number;
|
|
47
|
+
greenwichApparentSiderialTime(jd: number, deltaT: number): number;
|
|
48
|
+
localApparentSiderialTime(jd: number, deltaT: number, gLon: number): number;
|
|
49
|
+
sunGeocentricGreenwichHourAngle(jd: number, deltaT: number): number;
|
|
50
|
+
sunGeocentricLocalHourAngle(jd: number, deltaT: number, gLon: number): number;
|
|
51
|
+
sunGeocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
52
|
+
sunGeocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number): number;
|
|
53
|
+
sunGeocentricSemidiameter(jd: number, deltaT: number): number;
|
|
54
|
+
sunEquatorialHorizontalParallax(jd: number, deltaT: number): number;
|
|
55
|
+
termU(gLat: number): number;
|
|
56
|
+
termX(gLat: number, elev: number): number;
|
|
57
|
+
termY(gLat: number, elev: number): number;
|
|
58
|
+
termN(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
59
|
+
parallaxInTheSunRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
60
|
+
parallaxInTheSunAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
61
|
+
atmosphericRefractionFromAirlessAltitude(airlessAltitude: number, pressure: number, temperature: number): number;
|
|
62
|
+
sunTopocentricLongitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
63
|
+
sunTopocentricLatitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
64
|
+
sunTopocentricRightAscension(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
65
|
+
sunTopocentricDeclination(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
66
|
+
sunTopocentricGreenwichHourAngle(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
67
|
+
sunTopocentricLocalHourAngel(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
68
|
+
sunTopocentricAzimuth(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
69
|
+
sunTopocentricAltitude(jd: number, deltaT: number, gLon: number, gLat: number, elev: number, pres: number, temp: number, opt: string): number;
|
|
70
|
+
sunTopocentricSemidiameter(jd: number, deltaT: number, gLon: number, gLat: number, elev: number): number;
|
|
71
|
+
equationOfTime(jd: number, deltaT: number): number;
|
|
72
|
+
jdGhurubSyams(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
73
|
+
jdGhurubSyams2(jdNM: number, gLat: number, gLon: number, gAlt: number, tmZn: number): number;
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MathFunction as e}from"../math/math-utils.js";import{DynamicalTime as t}from"./dynamical-time.js";import{JulianDay as n}from"./julian-day.js";import{NutationAndObliquity as r}from"./nutation.js";import{SunDataL00 as i}from"../../data/sun-data-l00.js";import{SunDataL01 as a}from"../../data/sun-data-l01.js";import{SunDataL02 as o}from"../../data/sun-data-l02.js";import{SunDataL03 as s}from"../../data/sun-data-l03.js";import{SunDataL04 as c}from"../../data/sun-data-l04.js";import{SunDataL05 as l}from"../../data/sun-data-l05.js";import{SunDataB00 as u}from"../../data/sun-data-b00.js";import{SunDataB01 as d}from"../../data/sun-data-b01.js";import{SunDataB02 as f}from"../../data/sun-data-b02.js";import{SunDataB03 as p}from"../../data/sun-data-b03.js";import{SunDataB04 as m}from"../../data/sun-data-b04.js";import{SunDataR00 as h}from"../../data/sun-data-r00.js";import{SunDataR01 as g}from"../../data/sun-data-r01.js";import{SunDataR02 as _}from"../../data/sun-data-r02.js";import{SunDataR03 as v}from"../../data/sun-data-r03.js";import{SunDataR04 as y}from"../../data/sun-data-r04.js";import{SunDataR05 as b}from"../../data/sun-data-r05.js";var x=class{l00=i.vsop87MtL0;l01=a.vsop87MtL1;l02=o.vsop87MtL2;l03=s.vsop87MtL3;l04=c.vsop87MtL4;l05=l.vsop87MtL5;b00=u.vsop87MtB0;b01=d.vsop87MtB1;b02=f.vsop87MtB2;b03=p.vsop87MtB3;b04=m.vsop87MtB4;r00=h.vsop87MtR0;r01=g.vsop87MtR1;r02=_.vsop87MtR2;r03=v.vsop87MtR3;r04=y.vsop87MtR4;r05=b.vsop87MtR5;mf=new e;julianDay=new n;nt=new r;dt=new t;_cacheJdeL=null;_cacheL=null;_cacheJdeB=null;_cacheB=null;_cacheJdeR=null;_cacheR=null;earthHeliocentricLongitude(e,t){let n=e+t/86400;if(this._cacheJdeL===n&&this._cacheL!==null)return this._cacheL;let r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=0;for(let e=0;e<559;e++)a+=this.l00[e][0]*Math.cos(this.l00[e][1]+this.l00[e][2]*i);let o=0;for(let e=0;e<341;e++)o+=this.l01[e][0]*Math.cos(this.l01[e][1]+this.l01[e][2]*i);let s=0;for(let e=0;e<142;e++)s+=this.l02[e][0]*Math.cos(this.l02[e][1]+this.l02[e][2]*i);let c=0;for(let e=0;e<22;e++)c+=this.l03[e][0]*Math.cos(this.l03[e][1]+this.l03[e][2]*i);let l=0;for(let e=0;e<11;e++)l+=this.l04[e][0]*Math.cos(this.l04[e][1]+this.l04[e][2]*i);let u=0;for(let e=0;e<5;e++)u+=this.l05[e][0]*Math.cos(this.l05[e][1]+this.l05[e][2]*i);let d=this.mf.mod(this.mf.deg(a+o*i+s*i**2+c*i**3+l*i**4+u*i**5),360);return this._cacheJdeL=n,this._cacheL=d,d}earthHeliocentricLatitude(e,t){let n=e+t/86400;if(this._cacheJdeB===n&&this._cacheB!==null)return this._cacheB;let r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=0;for(let e=0;e<184;e++)a+=this.b00[e][0]*Math.cos(this.b00[e][1]+this.b00[e][2]*i);let o=0;for(let e=0;e<99;e++)o+=this.b01[e][0]*Math.cos(this.b01[e][1]+this.b01[e][2]*i);let s=0;for(let e=0;e<49;e++)s+=this.b02[e][0]*Math.cos(this.b02[e][1]+this.b02[e][2]*i);let c=0;for(let e=0;e<11;e++)c+=this.b03[e][0]*Math.cos(this.b03[e][1]+this.b03[e][2]*i);let l=0;for(let e=0;e<5;e++)l+=this.b04[e][0]*Math.cos(this.b04[e][1]+this.b04[e][2]*i);let u=this.mf.deg(a+o*i+s*i**2+c*i**3+l*i**4);return this._cacheJdeB=n,this._cacheB=u,u}earthRadiusVector(e,t){let n=e+t/86400;if(this._cacheJdeR===n&&this._cacheR!==null)return this._cacheR;let r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=0;for(let e=0;e<526;e++)a+=this.r00[e][0]*Math.cos(this.r00[e][1]+this.r00[e][2]*i);let o=0;for(let e=0;e<292;e++)o+=this.r01[e][0]*Math.cos(this.r01[e][1]+this.r01[e][2]*i);let s=0;for(let e=0;e<139;e++)s+=this.r02[e][0]*Math.cos(this.r02[e][1]+this.r02[e][2]*i);let c=0;for(let e=0;e<27;e++)c+=this.r03[e][0]*Math.cos(this.r03[e][1]+this.r03[e][2]*i);let l=0;for(let e=0;e<10;e++)l+=this.r04[e][0]*Math.cos(this.r04[e][1]+this.r04[e][2]*i);let u=0;for(let e=0;e<3;e++)u+=this.r05[e][0]*Math.cos(this.r05[e][1]+this.r05[e][2]*i);let d=a+o*i+s*i**2+c*i**3+l*i**4+u*i**5;return this._cacheJdeR=n,this._cacheR=d,d}sunGeocentricLongitude(e,t,n){let r=this.earthHeliocentricLongitude(e,t),i=this.earthHeliocentricLatitude(e,t),a=this.mf.mod(r+180,360),o=-i,s=e+t/86400,c=this.julianDay.jc(s),l=this.mf.mod(a-1.397*c-31e-5*c*c,360),u=a+(-.09033+.03916*(Math.cos(this.mf.rad(l))+Math.sin(this.mf.rad(l)))*Math.tan(this.mf.rad(o)))/3600,d=this.nt.nutationInLongitude(e,t),f=this.sunAberration(e,t)/3600,p=this.mf.mod(u+d+f,360);return n===`True`?u:p}sunGeocentricLatitude(e,t){let n=this.earthHeliocentricLongitude(e,t),r=this.earthHeliocentricLatitude(e,t),i=this.mf.mod(n+180,360),a=-r,o=e+t/86400,s=this.julianDay.jce(o),c=i-1.397*s-31e-5*s*s;return a+.03916*(Math.cos(this.mf.rad(c))-Math.sin(this.mf.rad(c)))/3600}sunGeocentricDistance(e,t,n){let r=this.earthRadiusVector(e,t),i=r,a=r*149597870.7,o=r*149597870.7/6371;switch(n){case`AU`:return i;case`KM`:return a;case`ER`:return o;default:return i}}sunAberration(e,t){let n=e+t/86400,r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=3548.33+118.568*Math.sin(this.mf.rad(87.5287+359993.7286*i))+2.476*Math.sin(this.mf.rad(85.0561+719987.4571*i))+1.376*Math.sin(this.mf.rad(27.8502+4452671.1152*i))+.119*Math.sin(this.mf.rad(73.1375+450368.8564*i))+.114*Math.sin(this.mf.rad(337.2264+329644.6718*i))+.086*Math.sin(this.mf.rad(222.54+659289.3436*i))+.078*Math.sin(this.mf.rad(162.8136+9224659.7915*i))+.054*Math.sin(this.mf.rad(82.5823+1079981.1857*i))+.052*Math.sin(this.mf.rad(171.5189+225184.4282*i))+.034*Math.sin(this.mf.rad(30.3214+4092677.3866*i))+.033*Math.sin(this.mf.rad(119.8105+337181.4711*i))+.023*Math.sin(this.mf.rad(247.5418+299295.6151*i))+.023*Math.sin(this.mf.rad(325.1526+315559.556*i))+.021*Math.sin(this.mf.rad(155.1241+675553.2846*i))+7.311*i*Math.sin(this.mf.rad(333.4515+359993.7286*i))+.305*i*Math.sin(this.mf.rad(330.9814+719987.4571*i))+.01*i*Math.sin(this.mf.rad(328.517+1079981.1857*i))+.309*i*i*Math.sin(this.mf.rad(241.4518+359993.7286*i))+.021*i*i*Math.sin(this.mf.rad(205.0482+719987.4571*i))+.004*i*i*Math.sin(this.mf.rad(297.861+4452671.1152*i))+.01*i*i*i*Math.sin(this.mf.rad(154.7066+359993.7286*i));return-.005775518*this.sunGeocentricDistance(e,t,`AU`)*a}sunGeocentricRightAscension(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t),i=this.nt.trueObliquityOfEcliptic(e,t);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(n))*Math.cos(this.mf.rad(i))-Math.tan(this.mf.rad(r))*Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(n)))),360)}sunGeocentricDeclination(e,t){let n=this.sunGeocentricLongitude(e,t,`Appa`),r=this.sunGeocentricLatitude(e,t),i=this.nt.trueObliquityOfEcliptic(e,t);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.cos(this.mf.rad(i))+Math.cos(this.mf.rad(r))*Math.sin(this.mf.rad(i))*Math.sin(this.mf.rad(n))))}greenwichMeanSiderialTime(e){let t=this.julianDay.jc(e);return this.mf.mod(280.46061837+360.98564736629*(e-2451545)+387933e-9*t**2-t**3/3871e4,360)}greenwichApparentSiderialTime(e,t){let n=this.greenwichMeanSiderialTime(e),r=this.nt.nutationInLongitude(e,t),i=this.nt.trueObliquityOfEcliptic(e,t);return this.mf.mod(n+r*Math.cos(this.mf.rad(i)),360)}localApparentSiderialTime(e,t,n){let r=this.greenwichApparentSiderialTime(e,t);return this.mf.mod(r+n,360)}sunGeocentricGreenwichHourAngle(e,t){let n=this.greenwichApparentSiderialTime(e,t),r=this.sunGeocentricRightAscension(e,t);return this.mf.mod(n-r,360)}sunGeocentricLocalHourAngle(e,t,n){let r=this.greenwichApparentSiderialTime(e,t),i=this.sunGeocentricRightAscension(e,t);return this.mf.mod(r+n-i,360)}sunGeocentricAzimuth(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(i)),Math.cos(this.mf.rad(i))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(a))*Math.cos(this.mf.rad(r))))+180,360)}sunGeocentricAltitude(e,t,n,r){let i=this.sunGeocentricLocalHourAngle(e,t,n),a=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(a))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(i))))}sunGeocentricSemidiameter(e,t){let n=this.earthRadiusVector(e,t);return(15+59.63/60)/n/60}sunEquatorialHorizontalParallax(e,t){return 8.794/(this.earthRadiusVector(e,t)*3600)}termU(e){return Math.atan(.99664719*Math.tan(this.mf.rad(e)))}termX(e,t){let n=this.termU(e);return Math.cos(n)+t/6378140*Math.cos(this.mf.rad(e))}termY(e,t){let n=this.termU(e);return .99664719*Math.sin(n)+t/6378140*Math.sin(this.mf.rad(e))}termN(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t),s=this.localApparentSiderialTime(e,t,n),c=this.termX(r,i),l=this.sunEquatorialHorizontalParallax(e,t);return Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))-c*Math.sin(this.mf.rad(l))*Math.cos(this.mf.rad(s))}parallaxInTheSunRightAscension(e,t,n,r,i){let a=this.termX(r,i),o=this.sunEquatorialHorizontalParallax(e,t),s=this.sunGeocentricLocalHourAngle(e,t,n),c=this.sunGeocentricDeclination(e,t);return this.mf.deg(Math.atan2(-a*Math.sin(this.mf.rad(o))*Math.sin(this.mf.rad(s)),Math.cos(this.mf.rad(c))-a*Math.sin(this.mf.rad(o))*Math.cos(this.mf.rad(s))))}parallaxInTheSunAltitude(e,t,n,r,i){let a=this.sunGeocentricAltitude(e,t,n,r),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t);return this.mf.deg(Math.sin(Math.sqrt(o*o+s*s)*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(a))))}atmosphericRefractionFromAirlessAltitude(e,t,n){let r=e,i=t,a=n;return(1.02/Math.tan(this.mf.rad(r+10.3/(r+5.11)))*i/1010*283/(273+a)+.0019279204034639303)/60}sunTopocentricLongitude(e,t,n,r,i){let a=this.sunGeocentricLongitude(e,t,`Appa`),o=this.sunGeocentricLatitude(e,t),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.trueObliquityOfEcliptic(e,t),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a))*Math.cos(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.sin(this.mf.rad(l))+u*Math.cos(this.mf.rad(l))*Math.sin(this.mf.rad(c))),f)),360)}sunTopocentricLatitude(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunGeocentricLatitude(e,t),s=this.sunEquatorialHorizontalParallax(e,t),c=this.localApparentSiderialTime(e,t,n),l=this.nt.trueObliquityOfEcliptic(e,t),u=this.termX(r,i),d=this.termY(r,i),f=this.termN(e,t,n,r,i);return this.mf.deg(Math.atan(Math.cos(this.mf.rad(a))*(Math.sin(this.mf.rad(o))-Math.sin(this.mf.rad(s))*(d*Math.cos(this.mf.rad(l))-u*Math.sin(this.mf.rad(l))*Math.sin(this.mf.rad(c))))/f))}sunTopocentricRightAscension(e,t,n,r,i){return this.sunGeocentricRightAscension(e,t)+this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricDeclination(e,t,n,r,i){let a=this.sunGeocentricDeclination(e,t),o=this.termY(r,i),s=this.termX(r,i),c=this.sunEquatorialHorizontalParallax(e,t),l=this.parallaxInTheSunRightAscension(e,t,n,r,i),u=this.sunGeocentricLocalHourAngle(e,t,n);return this.mf.deg(Math.atan2((Math.sin(this.mf.rad(a))-o*Math.sin(this.mf.rad(c)))*Math.cos(this.mf.rad(l)),Math.cos(this.mf.rad(a))-s*Math.sin(this.mf.rad(c))*Math.cos(this.mf.rad(u))))}sunTopocentricGreenwichHourAngle(e,t,n,r,i){let a=this.greenwichApparentSiderialTime(e,t),o=this.sunTopocentricRightAscension(e,t,n,r,i);return this.mf.mod(a-o,360)}sunTopocentricLocalHourAngel(e,t,n,r,i){return this.sunGeocentricLocalHourAngle(e,t,n)-this.parallaxInTheSunRightAscension(e,t,n,r,i)}sunTopocentricAzimuth(e,t,n,r,i){let a=this.sunTopocentricLocalHourAngel(e,t,n,r,i),o=this.sunTopocentricDeclination(e,t,n,r,i);return this.mf.mod(this.mf.deg(Math.atan2(Math.sin(this.mf.rad(a)),Math.cos(this.mf.rad(a))*Math.sin(this.mf.rad(r))-Math.tan(this.mf.rad(o))*Math.cos(this.mf.rad(r))))+180,360)}sunTopocentricAltitude(e,t,n,r,i,a,o,s){let c=this.sunTopocentricDeclination(e,t,n,r,i),l=this.sunTopocentricLocalHourAngel(e,t,n,r,i),u=1.75/60*Math.sqrt(i),d=this.sunTopocentricSemidiameter(e,t,n,r,i),f=this.mf.deg(Math.asin(Math.sin(this.mf.rad(r))*Math.sin(this.mf.rad(c))+Math.cos(this.mf.rad(r))*Math.cos(this.mf.rad(c))*Math.cos(this.mf.rad(l)))),p=f+d,m=f-d,h=this.atmosphericRefractionFromAirlessAltitude(p,a,o),g=this.atmosphericRefractionFromAirlessAltitude(f,a,o),_=this.atmosphericRefractionFromAirlessAltitude(m,a,o),v=p+h,y=f+g,b=m+_,x=v+u,S=y+u,C=b+u;switch(s){case`htu`:return p;case`htc`:return f;case`htl`:return m;case`htau`:return v;case`htac`:return y;case`htal`:return b;case`htou`:return x;case`htoc`:return S;case`htol`:return C;default:return f}}sunTopocentricSemidiameter(e,t,n,r,i){let a=this.sunTopocentricLongitude(e,t,n,r,i),o=this.sunTopocentricLatitude(e,t,n,r,i),s=this.sunGeocentricSemidiameter(e,t),c=this.termN(e,t,n,r,i);return this.mf.deg(Math.asin(Math.cos(this.mf.rad(a))*Math.cos(this.mf.rad(o))*Math.sin(this.mf.rad(s))/c))}equationOfTime(e,t){let n=e+t/86400,r=this.julianDay.jc(n),i=this.julianDay.jm(r),a=this.sunGeocentricRightAscension(e,t),o=this.nt.nutationInLongitude(e,t),s=this.nt.trueObliquityOfEcliptic(e,t),c=this.mf.mod(280.4664567+360007.6982779*i+.03032028*i**2+i**3/49931-i**4/15300-i**5/2e6,360)-.0057183-a+o*Math.cos(this.mf.rad(s));return Math.abs(c)*4<20?c/=15:Math.abs(c)*4>=20&&c>0?c=c/15-24:Math.abs(c)*4>=20&&c<0?c=c/15+24:c/=15,c}jdGhurubSyams(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+i/24);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}jdGhurubSyams2(e,t,n,r,i){let a,o=0,s,c,l,u,d,f,p,m,h,g,_=17;a=Math.floor(e+.5+0);for(let e=1;e<=2;e++)o=a-.5+(_-i)/24,s=o+this.dt.deltaT(o)/86400,c=this.sunGeocentricDeclination(s,0),l=this.sunGeocentricSemidiameter(s,0),u=this.equationOfTime(s,0),d=34.16/60,f=2.1*Math.sqrt(r)/60,p=-(l+d+f-.0024),m=(Math.sin(this.mf.rad(p))-Math.sin(this.mf.rad(t))*Math.sin(this.mf.rad(c)))/(Math.cos(this.mf.rad(t))*Math.cos(this.mf.rad(c))),Math.abs(m)<1?(h=this.mf.deg(Math.acos(m)),g=n/15-i,_=h/15+12-u-g,o=a-.5+(_-i)/24):o=0;return o}};export{x as SunFunction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=/* @__PURE__ */ function(e){return e.jdTD=`jdTD`,e.jdUT=`jdUT`,e}({});exports.TimeScale=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=/* @__PURE__ */ function(e){return e.jdTD=`jdTD`,e.jdUT=`jdUT`,e}({});export{e as TimeScale};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.dmod=function(e,t){let n=e%t;return n<0?n+Math.abs(t):n},exports.dround=function(e){return e<0?-Math.round(-e):Math.round(e)},exports.dstr=function(e){return Number.isNaN(e)?`NaN`:e===1/0?`Infinity`:e===-1/0?`-Infinity`:Object.is(e,-0)?`-0.0`:Number.isInteger(e)&&Math.abs(e)<1e21?`${e}.0`:String(e)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){let n=e%t;return n<0?n+Math.abs(t):n}function t(e){return e<0?-Math.round(-e):Math.round(e)}function n(e){return Number.isNaN(e)?`NaN`:e===1/0?`Infinity`:e===-1/0?`-Infinity`:Object.is(e,-0)?`-0.0`:Number.isInteger(e)&&Math.abs(e)<1e21?`${e}.0`:String(e)}export{e as dmod,t as dround,n as dstr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../dart.cjs"),t=require("./safe-math.cjs");var n=class{deg(e){return e*180/Math.PI}rad(e){return e*Math.PI/180}mod(e,n){if(!t.SafeMath.isValid(e)||!t.SafeMath.isValid(n)||n===0)return 0;let r=t.SafeMath.safeDiv(e,n);return e-n*Math.floor(r)}floor(e){return t.SafeMath.isValid(e)?Math.floor(e):0}abs(e){return Math.abs(e)}sign(e){return e>0?1:e<0?-1:0}roundDouble(e,t){return e.toFixed(t)}trunc(e,t=2){let n=10**t;return Math.trunc(e*n)/n}roundTo(t,{place:n=2}={}){let r=10**n,i=t>=0?this.floor(t*r+.5)/r:-this.floor(this.abs(t)*r+.5)/r;return e.dstr(i)}roundUp(e,t){let n=10**t;return Math.ceil(e*n)/n}dhhms(e,{optResult:t=`HH:MM:SS`,secDecPlaces:n=2,posNegSign:r=``}={}){let i=this.abs(e),a=this.floor(i),o=(i-a)*60,s=this.floor(o),c=((o-s)*60).toFixed(n);Number.parseFloat(c)===60&&(c=0 .toFixed(n),s+=1),s===60&&(s=0,a+=1);let l=Math.trunc(a),u=Math.trunc(s),d=l<10?`0${l}`:`${l}`,f=u<10?`0${u}`:`${u}`,p=Number.parseFloat(c)<10?`0${c}`:c,m;switch(m=r===`+-`&&e>0?`+`:e<0?`-`:``,t){case`HH:MM:SS`:return`${m}${d}:${f}:${p}`;case`HHMMSS`:return`${m}${d}h ${f}m ${p}s`;case`MMSS`:return`${m}${f}m ${p}s`;case`HH:MM`:return`${m}${d}:${f}`;default:return`${m}${d}:${f}:${p}`}}dhhm(t,{optResult:n=`HH:MM`,minDecPlaces:r=0,posNegSign:i=``}={}){let a=t<0,o=Math.abs(t),s=Math.floor(o),c=(o-s)*60,l=r===0?e.dround(c):Number.parseFloat(c.toFixed(r)),u=s,d=l;d>=60&&(d-=60,u+=1);let f=String(u).padStart(2,`0`),p=r===0?String(Math.trunc(d)).padStart(2,`0`):d.toFixed(r).padStart(3+r,`0`),m=``;switch(i===`+-`?(t>0&&(m=`+`),t<0&&(m=`-`)):a&&(m=`-`),n){case`HH:MM`:return`${m}${f}:${p}`;case`HHMM`:return`${m}${f}h ${p}m`;default:return`${m}${f}:${p}`}}dddms(e,{optResult:t=``,sdp:n,posNegSign:r=``}={}){let i=Math.abs(e),a=Math.floor(i),o=(i-a)*60,s=Math.floor(o),c=(o-s)*60,l=n??3;Math.abs(l)>16&&(l=3),l=Math.abs(l);let u=c.toFixed(l);Number.parseFloat(u)===60&&(s+=1),s===60&&(s=0,a+=1);let d=``,f=``;switch(r.replaceAll(` `,``).toUpperCase()){case``:d=e>=0?``:`-`;break;case`+/-`:case`-/+`:case`+-`:case`-+`:d=e>=0?`+`:`-`;break;case`B`:case`BUJUR`:f=e>=0?` BT`:` BB`;break;case`L`:case`LINTANG`:f=e>=0?` LU`:` LS`;break;case`LON`:case`LONG`:case`LONGITUDE`:f=e>=0?`E`:`W`;break;case`LAT`:case`LATITUDE`:f=e>=0?`N`:`S`;break;default:d=e>=0?``:`-`}let p=String(Math.trunc(a)),m=p.padStart(2,`0`),h=p.padStart(3,`0`),g=String(Math.trunc(s)),_=g.padStart(2,`0`),v=l===0?2:l+3,y=u.padStart(v,`0`);switch(t.replaceAll(` `,``).toUpperCase()){case``:case`DMMSS`:return`${d}${p}° ${_}’ ${y}”${f}`;case`DDMMSS`:return`${d}${m}° ${_}’ ${y}”${f}`;case`DDDMMSS`:return`${d}${h}° ${_}’ ${y}”${f}`;case`[D]`:return`${d}${p}`;case`[M]`:return`${d}${g}`;case`[S]`:return`${d}${u}`;case`D`:return`${d}${p}° ${f}`;case`M`:return`${d}${g}’ ${f}`;case`S`:return`${d}${u}”${f}`;case`MSS`:return`${d}${g}’ ${y}”${f}`;case`DMM`:return`${d}${p}° ${_}’ ${f}`;case`DDMM`:return`${d}${m}° ${_}’ ${f}`;case`DDDMM`:return`${d}${h}° ${_}’ ${f}`;case`DD`:return`${d}${m}° ${f}`;case`DDD`:return`${d}${h}° ${f}`;case`MM`:return`${d}${_}’ ${f}`;case`MMSS`:return`${d}${_}’ ${y}”${f}`;case`MS`:return`${d}${g}’ ${u}”${f}`;case`SS`:return`${d}${y}”${f}`;case`DM`:return`${d}${p}° ${g}’ ${f}`;case`DMS`:return`${d}${p}° ${g}’ ${u}”${f}`;default:return`${d}${p}° ${_}’ ${y}”${f}`}}dddms2(e,{optResult:t=`DDMMSS`,sdp:n=2,posNegSign:r=``}={}){let i=this.abs(e),a=this.floor(i).toFixed(0),o=(i-Number.parseFloat(a))*60,s=this.floor(o).toFixed(0),c=((o-Number.parseFloat(s))*60).toFixed(n);Number.parseFloat(c)===60&&(c=0 .toFixed(n),s=(Number.parseFloat(s)+1).toFixed(0)),Number.parseFloat(s)===60&&(s=`0`,a=(Number.parseFloat(a)+1).toFixed(0));let l;l=r===`+-`&&e>0?`+`:e<0?`-`:``;let u=e>0?`BT`:`BB`,d=e>0?`LU`:`LS`;switch(t){case`DDMMSS`:return`${l}${a}° ${s}’ ${c}”`;case`MMSS`:return`${l}${s}’ ${c}”`;case`SS`:return`${l}${c}”`;case`BBBT`:return`${l}${a}° ${s}’ ${c}” ${u}`;case`LULS`:return`${l}${a}° ${s}’ ${c}” ${d}`;default:return`${l}${a}° ${s}’ ${c}”`}}interp5(e,t,n,i,a,o){return r(t-e,n-t,i-n,a-i,n,o)}interp5Angle(e,t,n,i,a,o){return r(this.mod(t-e,360),this.mod(n-t,360),this.mod(i-n,360),this.mod(a-i,360),n,o)}safeNum(e){return e==null?null:typeof e==`number`&&Number.isFinite(e)?e:null}};function r(e,t,n,r,i,a){let o=t-e,s=n-t,c=r-n,l=s-o,u=c-s,d=u-l;switch(a){case 0:return i;case 1:return(t+n)/2-(l+u)/12;case 2:return s/2-d/24;case 3:return(l+u)/12;case 4:return d/24;default:return i}}exports.MathFunction=n;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Port `MathFunction` (persis_times/lib/src/core/math/math_utils.dart). */
|
|
2
|
+
export declare class MathFunction {
|
|
3
|
+
/** Radian → derajat. */
|
|
4
|
+
deg(x: number): number;
|
|
5
|
+
/** Derajat → radian. */
|
|
6
|
+
rad(x: number): number;
|
|
7
|
+
/** Modulus ala `a - m * floor(a / m)`; 0 bila input tidak valid. */
|
|
8
|
+
mod(a: number, m: number): number;
|
|
9
|
+
floor(value: number): number;
|
|
10
|
+
abs(x: number): number;
|
|
11
|
+
sign(x: number): number;
|
|
12
|
+
roundDouble(value: number, decimals: number): string;
|
|
13
|
+
trunc(value: number, decimals?: number): number;
|
|
14
|
+
/** Pembulatan manual ala RoundTo; hasil berupa string ala `double.toString()` Dart. */
|
|
15
|
+
roundTo(xDec: number, { place }?: {
|
|
16
|
+
place?: number;
|
|
17
|
+
}): string;
|
|
18
|
+
roundUp(value: number, decimals: number): number;
|
|
19
|
+
/** Format jam desimal → `HH:MM:SS` (atau `HHMMSS`, `MMSS`, `HH:MM`). */
|
|
20
|
+
dhhms(dHrs: number, { optResult, secDecPlaces, posNegSign }?: {
|
|
21
|
+
optResult?: string;
|
|
22
|
+
secDecPlaces?: number;
|
|
23
|
+
posNegSign?: string;
|
|
24
|
+
}): string;
|
|
25
|
+
/** Format jam desimal → `HH:MM` dengan menit dibulatkan. */
|
|
26
|
+
dhhm(dHrs: number, { optResult, minDecPlaces, posNegSign }?: {
|
|
27
|
+
optResult?: string;
|
|
28
|
+
minDecPlaces?: number;
|
|
29
|
+
posNegSign?: string;
|
|
30
|
+
}): string;
|
|
31
|
+
/**
|
|
32
|
+
* Derajat desimal → Derajat, Menit, Detik (DMS).
|
|
33
|
+
*
|
|
34
|
+
* @param optResult format: `DMMSS` (default), `DDMMSS`, `DDDMMSS`, `[D]`, `[M]`, `[S]`, `D`, `M`, `S`,
|
|
35
|
+
* `MSS`, `DMM`, `DDMM`, `DDDMM`, `DD`, `DDD`, `MM`, `MMSS`, `MS`, `SS`, `DM`, `DMS`.
|
|
36
|
+
* @param sdp jumlah desimal detik (default 3).
|
|
37
|
+
* @param posNegSign `''`, `'+/-'`, `'B'`/`'BUJUR'` (BT/BB), `'L'`/`'LINTANG'` (LU/LS), `'LON'` (E/W), `'LAT'` (N/S).
|
|
38
|
+
*/
|
|
39
|
+
dddms(xDecDeg: number, { optResult, sdp, posNegSign }?: {
|
|
40
|
+
optResult?: string;
|
|
41
|
+
sdp?: number | null;
|
|
42
|
+
posNegSign?: string;
|
|
43
|
+
}): string;
|
|
44
|
+
/** Format derajat versi 2: `DDMMSS` (default), `MMSS`, `SS`, `BBBT`, `LULS`. */
|
|
45
|
+
dddms2(dDeg: number, { optResult, sdp, posNegSign }?: {
|
|
46
|
+
optResult?: string;
|
|
47
|
+
sdp?: number;
|
|
48
|
+
posNegSign?: string;
|
|
49
|
+
}): string;
|
|
50
|
+
/** Interpolasi dari lima nilai tabular (`optResult` 0..4). */
|
|
51
|
+
interp5(xM2: number, xM1: number, x00: number, xP1: number, xP2: number, optResult: number): number;
|
|
52
|
+
/** Seperti {@link interp5} untuk sudut (selisih dimodulo 360). */
|
|
53
|
+
interp5Angle(xM2: number, xM1: number, x00: number, xP1: number, xP2: number, optResult: number): number;
|
|
54
|
+
safeNum(v: unknown): number | null;
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Port `MathFunction` (persis_times/lib/src/core/math/math_utils.dart). */
|
|
2
|
+
export declare class MathFunction {
|
|
3
|
+
/** Radian → derajat. */
|
|
4
|
+
deg(x: number): number;
|
|
5
|
+
/** Derajat → radian. */
|
|
6
|
+
rad(x: number): number;
|
|
7
|
+
/** Modulus ala `a - m * floor(a / m)`; 0 bila input tidak valid. */
|
|
8
|
+
mod(a: number, m: number): number;
|
|
9
|
+
floor(value: number): number;
|
|
10
|
+
abs(x: number): number;
|
|
11
|
+
sign(x: number): number;
|
|
12
|
+
roundDouble(value: number, decimals: number): string;
|
|
13
|
+
trunc(value: number, decimals?: number): number;
|
|
14
|
+
/** Pembulatan manual ala RoundTo; hasil berupa string ala `double.toString()` Dart. */
|
|
15
|
+
roundTo(xDec: number, { place }?: {
|
|
16
|
+
place?: number;
|
|
17
|
+
}): string;
|
|
18
|
+
roundUp(value: number, decimals: number): number;
|
|
19
|
+
/** Format jam desimal → `HH:MM:SS` (atau `HHMMSS`, `MMSS`, `HH:MM`). */
|
|
20
|
+
dhhms(dHrs: number, { optResult, secDecPlaces, posNegSign }?: {
|
|
21
|
+
optResult?: string;
|
|
22
|
+
secDecPlaces?: number;
|
|
23
|
+
posNegSign?: string;
|
|
24
|
+
}): string;
|
|
25
|
+
/** Format jam desimal → `HH:MM` dengan menit dibulatkan. */
|
|
26
|
+
dhhm(dHrs: number, { optResult, minDecPlaces, posNegSign }?: {
|
|
27
|
+
optResult?: string;
|
|
28
|
+
minDecPlaces?: number;
|
|
29
|
+
posNegSign?: string;
|
|
30
|
+
}): string;
|
|
31
|
+
/**
|
|
32
|
+
* Derajat desimal → Derajat, Menit, Detik (DMS).
|
|
33
|
+
*
|
|
34
|
+
* @param optResult format: `DMMSS` (default), `DDMMSS`, `DDDMMSS`, `[D]`, `[M]`, `[S]`, `D`, `M`, `S`,
|
|
35
|
+
* `MSS`, `DMM`, `DDMM`, `DDDMM`, `DD`, `DDD`, `MM`, `MMSS`, `MS`, `SS`, `DM`, `DMS`.
|
|
36
|
+
* @param sdp jumlah desimal detik (default 3).
|
|
37
|
+
* @param posNegSign `''`, `'+/-'`, `'B'`/`'BUJUR'` (BT/BB), `'L'`/`'LINTANG'` (LU/LS), `'LON'` (E/W), `'LAT'` (N/S).
|
|
38
|
+
*/
|
|
39
|
+
dddms(xDecDeg: number, { optResult, sdp, posNegSign }?: {
|
|
40
|
+
optResult?: string;
|
|
41
|
+
sdp?: number | null;
|
|
42
|
+
posNegSign?: string;
|
|
43
|
+
}): string;
|
|
44
|
+
/** Format derajat versi 2: `DDMMSS` (default), `MMSS`, `SS`, `BBBT`, `LULS`. */
|
|
45
|
+
dddms2(dDeg: number, { optResult, sdp, posNegSign }?: {
|
|
46
|
+
optResult?: string;
|
|
47
|
+
sdp?: number;
|
|
48
|
+
posNegSign?: string;
|
|
49
|
+
}): string;
|
|
50
|
+
/** Interpolasi dari lima nilai tabular (`optResult` 0..4). */
|
|
51
|
+
interp5(xM2: number, xM1: number, x00: number, xP1: number, xP2: number, optResult: number): number;
|
|
52
|
+
/** Seperti {@link interp5} untuk sudut (selisih dimodulo 360). */
|
|
53
|
+
interp5Angle(xM2: number, xM1: number, x00: number, xP1: number, xP2: number, optResult: number): number;
|
|
54
|
+
safeNum(v: unknown): number | null;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dround as e,dstr as t}from"../dart.js";import{SafeMath as n}from"./safe-math.js";var r=class{deg(e){return e*180/Math.PI}rad(e){return e*Math.PI/180}mod(e,t){if(!n.isValid(e)||!n.isValid(t)||t===0)return 0;let r=n.safeDiv(e,t);return e-t*Math.floor(r)}floor(e){return n.isValid(e)?Math.floor(e):0}abs(e){return Math.abs(e)}sign(e){return e>0?1:e<0?-1:0}roundDouble(e,t){return e.toFixed(t)}trunc(e,t=2){let n=10**t;return Math.trunc(e*n)/n}roundTo(e,{place:n=2}={}){let r=10**n,i=e>=0?this.floor(e*r+.5)/r:-this.floor(this.abs(e)*r+.5)/r;return t(i)}roundUp(e,t){let n=10**t;return Math.ceil(e*n)/n}dhhms(e,{optResult:t=`HH:MM:SS`,secDecPlaces:n=2,posNegSign:r=``}={}){let i=this.abs(e),a=this.floor(i),o=(i-a)*60,s=this.floor(o),c=((o-s)*60).toFixed(n);Number.parseFloat(c)===60&&(c=0 .toFixed(n),s+=1),s===60&&(s=0,a+=1);let l=Math.trunc(a),u=Math.trunc(s),d=l<10?`0${l}`:`${l}`,f=u<10?`0${u}`:`${u}`,p=Number.parseFloat(c)<10?`0${c}`:c,m;switch(m=r===`+-`&&e>0?`+`:e<0?`-`:``,t){case`HH:MM:SS`:return`${m}${d}:${f}:${p}`;case`HHMMSS`:return`${m}${d}h ${f}m ${p}s`;case`MMSS`:return`${m}${f}m ${p}s`;case`HH:MM`:return`${m}${d}:${f}`;default:return`${m}${d}:${f}:${p}`}}dhhm(t,{optResult:n=`HH:MM`,minDecPlaces:r=0,posNegSign:i=``}={}){let a=t<0,o=Math.abs(t),s=Math.floor(o),c=(o-s)*60,l=r===0?e(c):Number.parseFloat(c.toFixed(r)),u=s,d=l;d>=60&&(d-=60,u+=1);let f=String(u).padStart(2,`0`),p=r===0?String(Math.trunc(d)).padStart(2,`0`):d.toFixed(r).padStart(3+r,`0`),m=``;switch(i===`+-`?(t>0&&(m=`+`),t<0&&(m=`-`)):a&&(m=`-`),n){case`HH:MM`:return`${m}${f}:${p}`;case`HHMM`:return`${m}${f}h ${p}m`;default:return`${m}${f}:${p}`}}dddms(e,{optResult:t=``,sdp:n,posNegSign:r=``}={}){let i=Math.abs(e),a=Math.floor(i),o=(i-a)*60,s=Math.floor(o),c=(o-s)*60,l=n??3;Math.abs(l)>16&&(l=3),l=Math.abs(l);let u=c.toFixed(l);Number.parseFloat(u)===60&&(s+=1),s===60&&(s=0,a+=1);let d=``,f=``;switch(r.replaceAll(` `,``).toUpperCase()){case``:d=e>=0?``:`-`;break;case`+/-`:case`-/+`:case`+-`:case`-+`:d=e>=0?`+`:`-`;break;case`B`:case`BUJUR`:f=e>=0?` BT`:` BB`;break;case`L`:case`LINTANG`:f=e>=0?` LU`:` LS`;break;case`LON`:case`LONG`:case`LONGITUDE`:f=e>=0?`E`:`W`;break;case`LAT`:case`LATITUDE`:f=e>=0?`N`:`S`;break;default:d=e>=0?``:`-`}let p=String(Math.trunc(a)),m=p.padStart(2,`0`),h=p.padStart(3,`0`),g=String(Math.trunc(s)),_=g.padStart(2,`0`),v=l===0?2:l+3,y=u.padStart(v,`0`);switch(t.replaceAll(` `,``).toUpperCase()){case``:case`DMMSS`:return`${d}${p}° ${_}’ ${y}”${f}`;case`DDMMSS`:return`${d}${m}° ${_}’ ${y}”${f}`;case`DDDMMSS`:return`${d}${h}° ${_}’ ${y}”${f}`;case`[D]`:return`${d}${p}`;case`[M]`:return`${d}${g}`;case`[S]`:return`${d}${u}`;case`D`:return`${d}${p}° ${f}`;case`M`:return`${d}${g}’ ${f}`;case`S`:return`${d}${u}”${f}`;case`MSS`:return`${d}${g}’ ${y}”${f}`;case`DMM`:return`${d}${p}° ${_}’ ${f}`;case`DDMM`:return`${d}${m}° ${_}’ ${f}`;case`DDDMM`:return`${d}${h}° ${_}’ ${f}`;case`DD`:return`${d}${m}° ${f}`;case`DDD`:return`${d}${h}° ${f}`;case`MM`:return`${d}${_}’ ${f}`;case`MMSS`:return`${d}${_}’ ${y}”${f}`;case`MS`:return`${d}${g}’ ${u}”${f}`;case`SS`:return`${d}${y}”${f}`;case`DM`:return`${d}${p}° ${g}’ ${f}`;case`DMS`:return`${d}${p}° ${g}’ ${u}”${f}`;default:return`${d}${p}° ${_}’ ${y}”${f}`}}dddms2(e,{optResult:t=`DDMMSS`,sdp:n=2,posNegSign:r=``}={}){let i=this.abs(e),a=this.floor(i).toFixed(0),o=(i-Number.parseFloat(a))*60,s=this.floor(o).toFixed(0),c=((o-Number.parseFloat(s))*60).toFixed(n);Number.parseFloat(c)===60&&(c=0 .toFixed(n),s=(Number.parseFloat(s)+1).toFixed(0)),Number.parseFloat(s)===60&&(s=`0`,a=(Number.parseFloat(a)+1).toFixed(0));let l;l=r===`+-`&&e>0?`+`:e<0?`-`:``;let u=e>0?`BT`:`BB`,d=e>0?`LU`:`LS`;switch(t){case`DDMMSS`:return`${l}${a}° ${s}’ ${c}”`;case`MMSS`:return`${l}${s}’ ${c}”`;case`SS`:return`${l}${c}”`;case`BBBT`:return`${l}${a}° ${s}’ ${c}” ${u}`;case`LULS`:return`${l}${a}° ${s}’ ${c}” ${d}`;default:return`${l}${a}° ${s}’ ${c}”`}}interp5(e,t,n,r,a,o){return i(t-e,n-t,r-n,a-r,n,o)}interp5Angle(e,t,n,r,a,o){return i(this.mod(t-e,360),this.mod(n-t,360),this.mod(r-n,360),this.mod(a-r,360),n,o)}safeNum(e){return e==null?null:typeof e==`number`&&Number.isFinite(e)?e:null}};function i(e,t,n,r,i,a){let o=t-e,s=n-t,c=r-n,l=s-o,u=c-s,d=u-l;switch(a){case 0:return i;case 1:return(t+n)/2-(l+u)/12;case 2:return s/2-d/24;case 3:return(l+u)/12;case 4:return d/24;default:return i}}export{r as MathFunction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class{static sqrt(e){return e<0||!Number.isFinite(e)?0:Math.sqrt(e)}static asin(e){return Number.isFinite(e)?(e>1&&(e=1),e<-1&&(e=-1),Math.asin(e)):0}static acos(e){return Number.isFinite(e)?(e>1&&(e=1),e<-1&&(e=-1),Math.acos(e)):0}static safeDiv(e,t,{fallback:n=0}={}){if(!Number.isFinite(e)||!Number.isFinite(t)||t===0)return n;let r=e/t;return Number.isFinite(r)?r:n}static clamp(e,t,n){return Number.isFinite(e)?e<t?t:e>n?n:e:t}static isValid(e){return e!=null&&Number.isFinite(e)}};exports.SafeMath=e;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Port `SafeMath` (persis_times/lib/src/core/math/safe_math.dart). */
|
|
2
|
+
export declare class SafeMath {
|
|
3
|
+
static sqrt(value: number): number;
|
|
4
|
+
static asin(value: number): number;
|
|
5
|
+
static acos(value: number): number;
|
|
6
|
+
static safeDiv(a: number, b: number, { fallback }?: {
|
|
7
|
+
fallback?: number;
|
|
8
|
+
}): number;
|
|
9
|
+
static clamp(value: number, min: number, max: number): number;
|
|
10
|
+
static isValid(value: number | null | undefined): value is number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Port `SafeMath` (persis_times/lib/src/core/math/safe_math.dart). */
|
|
2
|
+
export declare class SafeMath {
|
|
3
|
+
static sqrt(value: number): number;
|
|
4
|
+
static asin(value: number): number;
|
|
5
|
+
static acos(value: number): number;
|
|
6
|
+
static safeDiv(a: number, b: number, { fallback }?: {
|
|
7
|
+
fallback?: number;
|
|
8
|
+
}): number;
|
|
9
|
+
static clamp(value: number, min: number, max: number): number;
|
|
10
|
+
static isValid(value: number | null | undefined): value is number;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class{static sqrt(e){return e<0||!Number.isFinite(e)?0:Math.sqrt(e)}static asin(e){return Number.isFinite(e)?(e>1&&(e=1),e<-1&&(e=-1),Math.asin(e)):0}static acos(e){return Number.isFinite(e)?(e>1&&(e=1),e<-1&&(e=-1),Math.acos(e)):0}static safeDiv(e,t,{fallback:n=0}={}){if(!Number.isFinite(e)||!Number.isFinite(t)||t===0)return n;let r=e/t;return Number.isFinite(r)?r:n}static clamp(e,t,n){return Number.isFinite(e)?e<t?t:e>n?n:e:t}static isValid(e){return e!=null&&Number.isFinite(e)}};export{e as SafeMath};
|