Solved: what is wrong with this LatLong>Distance code? A Trigonometry "feature".

10132016, 05:31 PM
(This post was last modified: 10132016 05:33 PM by Tim Wessman.)
Post: #6




RE: Can you see what is wrong with this LatLong>Distance code? Trigonometry bug?
If you are specifying an input in DMS then your value being input is degrees  essentially you have tagged it with a unit. What would be the expected behavior for these cases?
SIN(1.5) SIN(1.5_grad) SIN(1.5_rad) SIN(1°30') Seems to me the first would be dependent on your setting and all the rest are essentially units that can be directly handled no matter your system setting to give the correct result. Since DMS is an inherent part of the number, you don't have to do conversions between steps to calculate using DMS. Thus something like 5°15' * 3 is a perfectly valid calculation and returns a DMS result. Anyway, I think you have your answer about the bug. If you want to be completely independent of your setting, run HMS> (doesn't matter if you are are in HMS or not, just sets the flag on the real number input) then D>R. I'm wondering now though if HMS> and >HMS should also handle angular unit objects directly so something like >HMS(1.5_rad) would return 85°56′37.20937″ ... thoughts anyone? TW Although I work for HP, the views and opinions I post here are my own. 

« Next Oldest  Next Newest »

User(s) browsing this thread: