-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SE_TRUE_NODE returns different values on chrome and windows #13
Comments
Thanks for reporting this. I will look into it and get back. |
@ynvgib Here is the code I added to the example:
my result:
|
Strange bug flies in the room then.
For now I'll keep it at that...
Don't know what to do.
Thanks
…On Sun, Jan 21, 2024, 17:19 vm75 ***@***.***> wrote:
I do see some difference in my setup, but not as much as you, especially
for example 2. Android Studio version should not matter as Android isn't
being tested. Having said that, presently WASM is 32-bit, whereas FFI is
64-bit. That may affect some floating point calculations.
Here is the code I added to the example:
// var time = DateTime(2024, 01, 16, 7, 30); // 2024-01-16 07:30:00.000
// var time = DateTime(1983, 10, 3, 13, 15); // 1983-10-03 13:15:00.000
var time = DateTime(1978, 05, 21, 00, 30); // 1978-05-21 00:30:00.000
double jd = Sweph.swe_julday(time.year, time.month, time.day,
time.hour + time.minute / 60, CalendarType.SE_GREG_CAL);
CoordinatesWithSpeed posSun, posNorthnode;
posSun = Sweph.swe_calc_ut(jd, HeavenlyBody.SE_SUN, SwephFlag.SEFLG_SWIEPH);
posNorthnode =
Sweph.swe_calc_ut(jd, HeavenlyBody.SE_TRUE_NODE, SwephFlag.SEFLG_SWIEPH);
double printNorthNode = posNorthnode.longitude;
double printSun = posSun.longitude;
debugPrint("time is $time");
debugPrint("jd time is $jd");
debugPrint("Sun: $printSun");
debugPrint("North Node is: $printNorthNode");
my result:
CHROME
time is 2024-01-16 07:30:00.000
jd time is 2460325.8125
Sun: 295.6463757021934
North Node is: 19.581430913105162
Windows
flutter: time is 2024-01-16 07:30:00.000
flutter: jd time is 2460325.8125
flutter: Sun: 295.6463757021932
flutter: North Node is: 19.581430913105162
CHROME
time is 1983-10-03 13:15:00.000
jd time is 2445611.0520833335
Sun: 189.75635745500242
North Node is: 78.61301401943668
Windows
flutter: time is 1983-10-03 13:15:00.000
flutter: jd time is 2445611.0520833335
flutter: Sun: 189.75635745500242
flutter: North Node is: 78.61301401943668
CHROME
time is 1978-05-21 00:30:00.000
jd time is 2443649.5208333335
Sun: 59.61371667811282
North Node is: 184.55327434949876
Windows
flutter: time is 1978-05-21 00:30:00.000
flutter: jd time is 2443649.5208333335
flutter: Sun: 59.61371667811284
flutter: North Node is: 184.5532743488916
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOHVI5JJM2BJLWJQTIMHX3YPVE3BAVCNFSM6AAAAABB4LDJMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBSG4YDANZZGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I created a clean project with minimal code just to check:
and the result were: _chrome === flutter: time is 1983-10-03 13:15:00.000 ============== time is 1978-05-21 00:30:00.000 2 flutter: time is 1978-05-21 00:30:00.000 ====_ so the "glitch" on the northnode turns minor to none 1: North Node is: 184.55327434 then 949876 Sun is pretty much equal. I don't really know where that bug comes from. |
It could well be to do with with javascript floating-point precision limitations? I had a similar issue years ago with a game related project. Perhaps you could make use of decimal.js or scale the high precision values to integers for calculations and then scale back down to original units? |
I don't know. It is in flutter so I found this flutter (dart) package However, the calculation right on Windows I'm not sure about the 32bit or 64 bit difference, or the web/android vs windows calculation. |
@vm75 North Node is the main issue I encounter with A LARGE DIFFRENCE as mentioned North Node1 : 78.61301401943668 As I wrote, so perhaps the old Project uses only 32bit for WINDOWS, but 64bit for CHROME (WEB),
|
I am using these functions in the code to return the SUN and TRUE_NODE (north node):
I am using this ephemeris:
There is a CLEAR DIFFERENCE in the TRUE_NODE, but also a slight one in the SUN.
these are the printed times and data:
===
EXAMPLE 1:
CHROME:
time is 2024-01-16 07:30:00.000
jd time is 2460325.8125
Sun: 295.6463757021934
North Node is: 19.581430913105162
WINDOWS:
flutter: time is 2024-01-16 07:30:00.000
flutter: jd time is 2460325.8125
flutter: Sun: 295.6463757021932
flutter: North Node is: 19.582942888102373
==============
EX.2
CHROME:
time is 1983-10-03 13:15:00.000
jd time is 2445611.0520833335
Sun: 189.75635745500242
North Node is: 78.61301401943668
WINDOWS:
flutter: time is 1983-10-03 13:15:00.000
flutter: jd time is 2445611.0520833335
flutter: Sun: 189.75635745500242
flutter: North Node is: 78.61875087620729
Ex. 3
CHROME:
time is 1978-05-21 00:30:00.000
jd time is 2443649.5208333335
Sun: 59.61371667811282
North Node is: 184.55327434949876
WINDOWS:
flutter: time is 1978-05-21 00:30:00.000
flutter: jd time is 2443649.5208333335
flutter: Sun: 59.61371667811284
flutter: North Node is: 184.54967016401204
=====
I am using Android Studio Flamingo | 2022.2.1 Patch 2
and flutter:
PS C:\Users\val\projects\flutter\finallyicanlearn> flutter --version
Flutter 3.16.0-10.0.pre • channel master • https://github.com/flutter/flutter.git
Framework • revision c0d19ca561 (3 months ago) • 2023-10-11 23:33:07 -0400
Engine • revision d00fabf0b9
Tools • Dart 3.3.0 (build 3.3.0-14.0.dev) • DevTools 2.28.1
SWEPH: sweph 2.10.3+16
The text was updated successfully, but these errors were encountered: