Editing Talk:2807: Bad Map Projection: ABS(Longitude)

Jump to: navigation, search
Ambox notice.png Please sign your posts with ~~~~

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 32: Line 32:
  
 
The formula added in the "Correct formula" section of the explanation is not consistent with how Randall has overlaid the negative longitudes on top of the positive longitudes.  This section was added by an anonymous editor.  This formula mirrors the negative longitudes into positive longitudes but leaves them in a separate hemisphere from the positive longitudes, without overlaying the two hemispheres as Randall has done.  I think this section needs to be removed completely.  Anyone else agree? [[User:Ianrbibtitlht|Ianrbibtitlht]] ([[User talk:Ianrbibtitlht|talk]]) 19:29, 28 July 2023 (UTC)
 
The formula added in the "Correct formula" section of the explanation is not consistent with how Randall has overlaid the negative longitudes on top of the positive longitudes.  This section was added by an anonymous editor.  This formula mirrors the negative longitudes into positive longitudes but leaves them in a separate hemisphere from the positive longitudes, without overlaying the two hemispheres as Randall has done.  I think this section needs to be removed completely.  Anyone else agree? [[User:Ianrbibtitlht|Ianrbibtitlht]] ([[User talk:Ianrbibtitlht|talk]]) 19:29, 28 July 2023 (UTC)
:I edited it. Not the author, but I think the intent was that this is what correct formula ''should'' have been used, instead of the "whoops!" indident where he actually used abs().
 
:So I made it more clear (or, possibly less, you decide), plus added another alternative positive-normalising form of formula.
 
:Though the use of mod (or % operator) may depend upon the mod-function implementation involved (whether it even needs the +360, can handle float longitudes, can perhaps even work well beyond -180..+180 input...) but it *can* be the much clearer method. Just test it with various values from all quadrants (and beyond +-180) ahead of time to make sure (what the comic map's creator should have done with ''their'' method).
 
:Or, in code, just run something like <code>while (lon<0) {lon+=360}; while (lon>=360) {lon-=360};</code>, or however that'd work in your chosen coding dialect's syntax. And you might need to accept a possible bit of loop-spam if the input is somehow vastly high/low, but it works well in skipping over entirely unnecessary multiplative/divisive operations (it'll do no more than one of the loops, on the way past).
 
:TMTOWTDI, though, and the usable methods are practically unlimited, I'd probably use whatever method looks good against the surrounding code (or shuttle it away into a subprocedure call, where I now make it look neat alongside its fellow subs).
 
:Anyway, I think that section isn't necessary, but it may be of interest. [[Special:Contributions/162.158.74.63|162.158.74.63]] 21:25, 28 July 2023 (UTC)
 
  
 
I wondered why it got so frigid and hard-to-breath overnight. Thanks a lot, Randal, for moving me to the Himalayas.[[User:These Are Not The Comments You Are Looking For|These Are Not The Comments You Are Looking For]] ([[User talk:These Are Not The Comments You Are Looking For|talk]]) 02:23, 1 August 2023 (UTC)
 
I wondered why it got so frigid and hard-to-breath overnight. Thanks a lot, Randal, for moving me to the Himalayas.[[User:These Are Not The Comments You Are Looking For|These Are Not The Comments You Are Looking For]] ([[User talk:These Are Not The Comments You Are Looking For|talk]]) 02:23, 1 August 2023 (UTC)

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)

Template used on this page: