Giter VIP home page Giter VIP logo

Comments (7)

PaulWessel avatar PaulWessel commented on June 4, 2024

This might be a simpler example of what @seisman pointed out (those towers near TL BL corners for grids subjected to blending. Darn, can you remind moe of that issue, @seisman ?

from gmt.

joa-quim avatar joa-quim commented on June 4, 2024

GenericMappingTools/pygmt#2511 ?

from gmt.

PaulWessel avatar PaulWessel commented on June 4, 2024

Yes. I will try to debug @Esteban82 example - it is annoying but I spent a lot of time on the grid version already...

from gmt.

PaulWessel avatar PaulWessel commented on June 4, 2024

This is what I have learned. grdtrack -E creates the profiles, then the cross track machinery computes the angle of the cross profiles to be 180. Then we can sincosd (angle, &s, &c) and get cos = -1 (good) and sin = -1.2246467991473532E-16 (oops). Then, coordinates are computed and instead of getting y = 1 we get 0.99999999999999988 and then it is determined by BCR that the point is outside the grid and we get the default NaN answer.

I think for some reason sincosd fails since it actually calls sincos (angle*D2R) and hence roundoff is likely. So where do we intercept? Make the macro check for angle being exact multiple of 90 and set those returns manually? This is in many places... Suggestions - gotta take a break.

from gmt.

joa-quim avatar joa-quim commented on June 4, 2024

from gmt.

joa-quim avatar joa-quim commented on June 4, 2024

from gmt.

PaulWessel avatar PaulWessel commented on June 4, 2024

Lamely, this fixes the issue

angle = 90.0 - az_cross - deviation;	/* The direction */
sincosd (angle, &sa, &ca);	/* Trig on the direction */
i_angle = rint (angle);
if (i_angle == 0 || i_angle == 360) sa = 0.0, ca = 1.0;
else if (i_angle == 90) sa = 1.0, ca = 0.0;
else if (i_angle == 180 || i_angle == -180) sa = 0.0, ca = -1.0;
else if (i_angle == 270 || i_angle == -90) sa = -1.0, ca = 0.0;

from gmt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.