Skip to content

Meridional wrapping #53

Description

@awickert

This code was used to wrap the 0--360 longitude grid at the prime meridian. It was part of dephier.hpp (see https://github.com/KCallaghan/WTM/blob/midpoint/src/dephier.hpp). This wrapping is not yet fully implemented, so it is being stored over here for the time being

// The regular mod function allows negative numbers to stay negative. This mod
// function wraps negative numbers around. For instance, if a=-1 and n=100, then
// the result is 99.
static int ModFloor(int a, int n) {
  return ((a % n) + n) % n;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions