Click here to Skip to main content
15,904,652 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: WSO CCC 11/04/2016 Pin
Pirate Guy11-Apr-16 1:31
Pirate Guy11-Apr-16 1:31 
GeneralRe: WSO CCC 11/04/2016 Pin
908236511-Apr-16 3:24
908236511-Apr-16 3:24 
GeneralRe: WSO CCC 11/04/2016 Pin
Kornfeld Eliyahu Peter11-Apr-16 3:44
professionalKornfeld Eliyahu Peter11-Apr-16 3:44 
GeneralRe: WSO CCC 11/04/2016 Pin
Pirate Guy11-Apr-16 3:47
Pirate Guy11-Apr-16 3:47 
GeneralRe: WSO CCC 11/04/2016 Pin
908236511-Apr-16 4:21
908236511-Apr-16 4:21 
GeneralRe: WSO CCC 11/04/2016 Pin
Pirate Guy11-Apr-16 17:50
Pirate Guy11-Apr-16 17:50 
PraiseRe: WSO CCC 11/04/2016 Pin
pkfox11-Apr-16 4:29
professionalpkfox11-Apr-16 4:29 
GeneralIt's not very pretty, is it... Pin
Chris C-B10-Apr-16 22:57
Chris C-B10-Apr-16 22:57 
OR…
Why VB is better than C#. Poke tongue | ;-P

Back in the days before GPS, and when Transit took up half the bridge on a destroyer, I navigated by sextant and Admiralty tables. After four years working in Iraq, I took a year off to go sailing, so thought I would computerise the tables function – using an HP75C (no Interwebs back then). I built a digital almanac in HP Basic, good for plus or minus 3k years, handling the Sun, Moon and GHA Aries. I had to jump through a few hoops to fit it all into 24k, but it worked admirably – worst landfall error 1/3 of a mile.

Later, I rewrote it in Classic VB and added the six navigational planets, and a star catalogue of the 57 navigational stars plus Polaris. Then I moved it into VB.net, and added a few more bells and whistles, just for the hell of it - running fixes, great circle routes etc.

I have now decided to put it into C#, and Xamarinate™ it for my Android tablet. Yesterday, I had a quick look through the code to see what gotchas might lie hidden and…

An eleven element array containing the relevant constants, and a loop:
For I = 0 to 10
X = X + array(I) * Tu^I
Next 


Has now turned into
X = 0.40909280422233 _
- 0.02269378904316 * Tu _
- 0.00000751461206 * Tu * Tu _
+ 0.00969263751958 * Tu * Tu * Tu _
- 0.00024909726935 * Tu * Tu * Tu * Tu _
- 0.00121043431763 * Tu * Tu * Tu * Tu * Tu _
- 0.00018931974247 * Tu * Tu * Tu * Tu * Tu * Tu _
+ 0.00003451873409 * Tu * Tu * Tu * Tu * Tu * Tu * Tu _
+ 0.00013511757293 * Tu * Tu * Tu * Tu * Tu * Tu * Tu * Tu _
+ 0.00002807071214 * Tu * Tu * Tu * Tu * Tu * Tu * Tu * Tu * Tu _
+ 0.00001187793519 * Tu * Tu * Tu * Tu * Tu * Tu * Tu * Tu * Tu * Tu

This is just one of dozens of functions using exponentiation.
Please can I scream now? Laugh | :laugh:

P.S. Bonus points for identifying the function.
GeneralRe: It's not very pretty, is it... Pin
Rage10-Apr-16 22:59
professionalRage10-Apr-16 22:59 
GeneralRe: It's not very pretty, is it... Pin
Chris C-B10-Apr-16 23:12
Chris C-B10-Apr-16 23:12 
GeneralRe: It's not very pretty, is it... Pin
Jochen Arndt10-Apr-16 23:20
professionalJochen Arndt10-Apr-16 23:20 
GeneralRe: It's not very pretty, is it... Pin
Chris C-B10-Apr-16 23:49
Chris C-B10-Apr-16 23:49 
GeneralRe: It's not very pretty, is it... Pin
Jochen Arndt11-Apr-16 0:03
professionalJochen Arndt11-Apr-16 0:03 
GeneralRe: It's not very pretty, is it... Pin
Chris C-B11-Apr-16 0:33
Chris C-B11-Apr-16 0:33 
GeneralRe: It's not very pretty, is it... Pin
Jochen Arndt11-Apr-16 1:08
professionalJochen Arndt11-Apr-16 1:08 
GeneralRe: It's not very pretty, is it... Pin
Chris C-B11-Apr-16 2:53
Chris C-B11-Apr-16 2:53 
GeneralRe: It's not very pretty, is it... Pin
Kornfeld Eliyahu Peter10-Apr-16 23:18
professionalKornfeld Eliyahu Peter10-Apr-16 23:18 
GeneralRe: It's not very pretty, is it... Pin
Jörgen Andersson10-Apr-16 23:27
professionalJörgen Andersson10-Apr-16 23:27 
GeneralRe: It's not very pretty, is it... Pin
Kornfeld Eliyahu Peter10-Apr-16 23:39
professionalKornfeld Eliyahu Peter10-Apr-16 23:39 
GeneralRe: It's not very pretty, is it... Pin
Daniel Pfeffer11-Apr-16 1:08
professionalDaniel Pfeffer11-Apr-16 1:08 
GeneralRe: It's not very pretty, is it... Pin
Chris C-B11-Apr-16 4:52
Chris C-B11-Apr-16 4:52 
GeneralRe: It's not very pretty, is it... Pin
BillWoodruff11-Apr-16 2:34
professionalBillWoodruff11-Apr-16 2:34 
GeneralRe: It's not very pretty, is it... Pin
Chris C-B11-Apr-16 3:02
Chris C-B11-Apr-16 3:02 
GeneralRe: It's not very pretty, is it... Pin
Mark_Wallace11-Apr-16 7:52
Mark_Wallace11-Apr-16 7:52 
GeneralWho's up for the CCC ? Pin
pkfox10-Apr-16 22:39
professionalpkfox10-Apr-16 22:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.