MCPcopy Create free account
hub / github.com/davidrmiller/biosim4 / normalize

Method normalize

src/basicTypes.cpp:84–87  ·  view source on GitHub ↗

A normalized Coord has x and y == -1, 0, or 1. A normalized Coord may be used as an offset to one of the 8-neighbors. We'll convert the Coord into a Dir, then convert Dir to normalized Coord. */

Source from the content-addressed store, hash-verified

82 We'll convert the Coord into a Dir, then convert Dir to normalized Coord.
83*/
84Coord Coord::normalize() const
85{
86 return asDir().asNormalizedCoord();
87}
88
89
90// Effectively, we want to check if a coordinate lies in a 45 degree region (22.5 degrees each side)

Callers 1

unitTestBasicTypesFunction · 0.80

Calls 1

asNormalizedCoordMethod · 0.80

Tested by 1

unitTestBasicTypesFunction · 0.64