lortordermur / sfcalcsheet

The science fiction calculation spreadsheet
The Unlicense
38 stars 2 forks source link

Equatorial to Galactic and Trig calc PLS #5

Closed ARGHouse closed 2 months ago

ARGHouse commented 2 years ago

I'm working on 3D starmaps in Astrosynth and Pioneer, I usually have to go through around 5 to 10 minutes hopping between my calculator and various online calculators and converters so I can convert Equatorial in to Galactic, and then calculate the trigonomic values so I can get cartesian co-ordinates. Would be handy if this calculator also had an Equatorial to Galactic converter, along with a right angle trig calculator for getting cartesian co-ordinates.

jchylik commented 2 months ago

maybe the cartesian calculator that the OP asked for.

Cartesian calculator is simple. Though there is always a question of the units (ly, parsec, ...) and the planet that is a reference point (0,0,0)

lortordermur commented 2 months ago

SFCalcSheet uses SI units, so I would suggest parsec. It also has a LY <-> parsec converter.

lortordermur commented 2 months ago

If I use 250 and -45 in the forward and reverse calculators in the file you provided, the l and α results seem to be off.

jchylik commented 2 months ago

If I use 250 and -45 in the forward and reverse calculators in the file you provided, the l and α results seem to be off

Oh, I see, the longitude and lattitude were swapped (in the calculation). sfcalcsheet-temp-j2.ods

lortordermur commented 2 months ago

Still doesn’t figure out 100% … l should be 339.378942 and α 65.229915 according to the NED calculator.

jchylik commented 2 months ago

Still doesn’t figure out 100% … l should be 339.378942 and α 65.229915 according to the NED calculator.

I am getting the same values in the Spreadsheet as in NED screenshot_ned

lortordermur commented 2 months ago

In the j2 file? It somehow shows me different values but if it works for you, I will clean up a bit and check it into Git. sfcalcsheet-j2

lortordermur commented 2 months ago

Alright, it's in Git. I will release 0.20 tomorrow or on Sunday.

jchylik commented 2 months ago

It somehow shows me different values

Well, the values in the screenshot are still those from the formula that you used before.

The C56 in the screenshot is still the value from G56, etc...

Fixed equatorial <-> galactic converter (see issue #5)

The Equatorial to Cartesian coordinates works.

lortordermur commented 2 months ago

Could you have a look at the 0.20 release version? I could then release a 0.20.1 hotfix if necessary.

jchylik commented 2 months ago

Could you have a look at the 0.20 release version? I could then release a 0.20.1 hotfix if necessary.

I have had. The forward and backward transformation match only for a certain segment. Once we insert the values out of the segment, it does not match anymore. screenshot_forward_backward

jchylik commented 2 months ago

You can try to test this: sfcalcsheet_25aug_hotfix.ods

lortordermur commented 2 months ago

Ok – I fixed the result fields and the hotfix release is on the way.

lortordermur commented 2 months ago

Hotfix released. Can you verify?

@ARGHouse: Are you satisfied with the new two calculators (equatorial <-> galactic and equatorial to cartesian)? If everything is good the issue can be closed.

jchylik commented 2 months ago

Hotfix released. Can you verify?

Yes, I can confirm it works for all quadrants, and matches for backward and forward angles.

Other good news it works even if the user inserts values out of "allowed" range, such as (-370, 100).

lortordermur commented 2 months ago

Yes, I saw a mod 360 in some cell, that might be why.

This is possibly the first time this complex kind of coordinate conversion has been implemented in a spreadsheet :-)

jchylik commented 2 months ago

Yes, I saw a mod 360 in some cell, that might be why.

Not really, I was worried on the inputs. Mod( *,360) is applied on the outputs for l and alpha.

This is possibly the first time this complex kind of coordinate conversion has been implemented in a spreadsheet :-)

Well, not by a long shot. Have you seen some of the macro-economic simulations built within a spreadsheet? Not to mention pendelum simulator or a full RPG ... The 7 most epic Excel creations ever

lortordermur commented 2 months ago

Ah, I already knew about the Japanese man doing impressive art in Excel … but yeah, once you throw BASIC programming in, you can code games and similar.

lortordermur commented 2 months ago

It seems that we have implemented the requested calculators and did that correctly. Closing issue.