mrJean1 / PyGeodesy

Pure Python geodesy tools
https://mrjean1.github.io/PyGeodesy/
297 stars 58 forks source link

Extend intermediateTo to support any number as a fraction #8

Closed naktinis closed 7 years ago

naktinis commented 7 years ago

Currently it only supports range 0..1 but it is not too difficult to extend it to support an arbitrary distance along great circle defined by self and other including negative values.

naktinis commented 7 years ago

Not sure what your opinion is about extending intermediateTo (which this issue was about). For some reason we were only discussing alongTrackDistanceTo.

mrJean1 commented 7 years ago

My apologies, I clicked the wrong issue, twice. The name intermediateTo (and intermediatePointTo) and the comments in the JS code implied that only factor values 0..1 were suitable. But the JS code puts no restriction on the factor value, I'd be happy to do that in the Python version.

naktinis commented 7 years ago

Completely agree about naming.

mrJean1 commented 7 years ago

Good. There are 3 spherical intermediate... methods and the fraction restriction is being removed for all, just to be consistent.

mrJean1 commented 7 years ago

All done in PyGeodesy-17.4.28 plus some other modifications.

naktinis commented 7 years ago

Are there any tests for fractions outside 0..1? I think h computation does not work for such values. Otherwise it looks ok.

mrJean1 commented 7 years ago

No tests, but I'll check with the original author. Also, I'll add a height keyword. If not None, it will replace the fractional default.

mrJean1 commented 7 years ago

A keyword argument height=None has been added to all intermediate...To and several other methods to override the computed, default or fractional height value in PyGeodesy-17.5.01+. There are other updates as well, including 2 simplistic tests for spherical and ellipsoidal intermediateTo methods with fraction values outside 0..1.

mrJean1 commented 7 years ago

@Naktinis, has this been resolved to your satisfaction?

naktinis commented 7 years ago

Seems to work as expected. Thank you.