Skip to content

Meridional wrapping #53

@awickert

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;
}

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